We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0bed62b commit 7e9535bCopy full SHA for 7e9535b
python/py_vapid/utils.py
@@ -26,14 +26,14 @@ def b64urlencode(data):
26
return base64.urlsafe_b64encode(data).replace(b'=', b'').decode('utf8')
27
28
29
-def num_to_bytes(n, l):
+def num_to_bytes(n, pad_to):
30
"""Returns the byte representation of an integer, in big-endian order.
31
:param n: The integer to encode.
32
:type n: int
33
- :param l: Expected length of result, zeropad if necessary.
34
- :type l: int
+ :param pad_to: Expected length of result, zeropad if necessary.
+ :type pad_to: int
35
:returns bytes
36
"""
37
h = '%x' % n
38
r = binascii.unhexlify('0' * (len(h) % 2) + h)
39
- return b'\x00' * (l - len(r)) + r
+ return b'\x00' * (pad_to - len(r)) + r
0 commit comments