This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MultiHash(object): | |
def __init__(self, initial_value, **kwargs): | |
self._hashes = [] | |
if hasattr(initial_value, 'read'): | |
file_handle = initial_value | |
args = tuple() | |
else: | |
file_handle = None | |
args = (initial_value,) | |
for algorithm in hashlib.algorithms: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am vxr on github. | |
* I am vxr (https://keybase.io/vxr) on keybase. | |
* I have a public key whose fingerprint is 3FBF 3F81 F35A 75BF 5517 5559 DA56 3B3E 7B3E 6BE9 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rorb(value): | |
return ((value >> 1) | ((value & 1) << 7)) & 0xFF | |
def rorb_count(value, count): | |
for x in range(count): | |
value = rorb(value) | |
return value |