oneid.utils

Helpful utility functions

oneid.utils.base64url_encode(msg)[source]

Default b64_encode adds padding, jwt spec removes padding :param input: :type input: string or bytes :return: base64 en :rtype: bytes

oneid.utils.base64url_decode(msg)[source]

JWT spec doesn’t allow padding characters. base64url_encode removes them, base64url_decode, adds them back in before trying to base64 decode the message

Parameters:msg (string or bytes) – URL safe base64 message
Returns:decoded data
Return type:bytes