calypso.utils.hash module
- calypso.utils.hash.hash_uints(uints, algo='sha256') str
Hash a list of non-negative integers
- Parameters:
- Returns:
Hash string.
- Return type:
Examples
>>> hash_uints([1, 2, 3]) 'WklgTrrOsQ8Sp8ZR6EqPqrbEKj0m6Je9U7zu-3vE1Gl'
- calypso.utils.hash.uint2base64(n: int) str
Base64-encoding non-negative integer
- Parameters:
n (int) – Non-negative integer.
- Returns:
Base64-encoded string.
- Return type:
- Raises:
ValueError – n is negative
Examples
>>> uint2base64(0) 'a' >>> list(map(uint2base64, [0, 25, 26, 51, 52, 61, 62, 63, 64])) ['a', 'z', 'A', 'Z', '0', '9', '-', '_', 'ab']