We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1caa130 commit d1060d3Copy full SHA for d1060d3
2 files changed
rsa/_compat.py
@@ -76,6 +76,11 @@ def byte_literal(s):
76
bytes_type = str
77
78
79
+# To avoid calling b() multiple times in tight loops.
80
+ZERO_BYTE = b('\x00')
81
+EMPTY_BYTE = b('')
82
+
83
84
def is_bytes(obj):
85
"""
86
Determines whether the given value is a byte string.
tests/test_common.py
@@ -34,6 +34,9 @@ def test_bad_type(self):
34
self.assertRaises(TypeError, byte_size, None)
35
36
class Test_bit_size(unittest2.TestCase):
37
+ def test_zero(self):
38
+ self.assertEqual(bit_size(0), 0)
39
40
def test_values(self):
41
self.assertEqual(bit_size(1023), 10)
42
self.assertEqual(bit_size(1024), 11)
0 commit comments