File tree 3 files changed +4
-4
lines changed
3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ methods provided by the hash objects in the standard library
81
81
82
82
.. method :: hash.hexdigest()
83
83
84
- Like :meth: `digest ` except the digest is returned as a bytes object
84
+ Like :meth: `digest ` except the digest is returned as a string object
85
85
of double length, containing only hexadecimal digits.
86
86
87
87
.. method :: hash.copy()
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ cdef bytes uint64le(uint64_t v):
32
32
return <bytes>r[:8]
33
33
34
34
35
- cdef bytes hexlify(uint64_t v):
35
+ cdef str hexlify(uint64_t v):
36
36
cdef char string[17]
37
37
PyOS_snprintf(
38
38
string, sizeof(string),
@@ -45,7 +45,7 @@ cdef bytes hexlify(uint64_t v):
45
45
<uint8_t>(v >> 40),
46
46
<uint8_t>(v >> 48),
47
47
<uint8_t>(v >> 56))
48
- return <bytes> string[:16]
48
+ return string[:16].decode('ascii')
49
49
50
50
51
51
{{for variant in "13", "24"}}
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def test_siphash24_data_and_key(self):
32
32
def test_siphash24_hexdigest (self ):
33
33
h = siphash24 .siphash24 ()
34
34
self .assertIsInstance (h .digest (), bytes )
35
- self .assertEqual (h .hexdigest (), binascii .hexlify (h .digest ()))
35
+ self .assertEqual (h .hexdigest (), binascii .hexlify (h .digest ()). decode ( 'ascii' ) )
36
36
37
37
def test_siphash24_name (self ):
38
38
h = siphash24 .siphash24 ()
You can’t perform that action at this time.
0 commit comments