MCPcopy Create free account
hub / github.com/authlib/authlib / int_to_base64

Function int_to_base64

authlib/common/encoding.py:55–60  ·  view source on GitHub ↗
(num)

Source from the content-addressed store, hash-verified

53
54
55def int_to_base64(num):
56 if num < 0:
57 raise ValueError("Must be a positive integer")
58
59 s = num.to_bytes((num.bit_length() + 7) // 8, "big", signed=False)
60 return to_unicode(urlsafe_b64encode(s))
61
62
63def json_b64encode(text):

Callers 4

dumps_private_keyMethod · 0.90
dumps_public_keyMethod · 0.90
dumps_private_keyMethod · 0.90
dumps_public_keyMethod · 0.90

Calls 2

to_unicodeFunction · 0.85
urlsafe_b64encodeFunction · 0.85

Tested by

no test coverage detected