File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ def to_ascii(byte_string):
22
22
23
23
def long_hash (* buffers ):
24
24
"""
25
- :param buffer: a binary buffer (e.g. serialized blob )
25
+ :param buffers: any number of binary buffers (e.g. serialized blobs )
26
26
:return: 43-character base64 ASCII rendition SHA-256
27
27
"""
28
28
hashed = hashlib .sha256 ()
@@ -33,11 +33,10 @@ def long_hash(*buffers):
33
33
34
34
def short_hash (* buffers ):
35
35
"""
36
- :param buffer: a binary buffer (e.g. serialized blob )
36
+ :param buffers: any number of binary buffers (e.g. serialized blobs )
37
37
:return: the first 8 characters of base64 ASCII rendition SHA-1
38
38
"""
39
39
hashed = hashlib .sha1 ()
40
40
for buffer in buffers :
41
41
hashed .update (buffer )
42
42
return to_ascii (hashed .digest ())[:8 ]
43
-
You can’t perform that action at this time.
0 commit comments