mendevi.utils.hash_to_signature

mendevi.utils.hash_to_signature(checksum: bytes) str[source]

Convert the md5 binary hash value into an urlsafe string.

Bijection of signature_to_hash().

Parameters

checksumbytes

The 128 bit binary hash value.

Returns

signaturestr

The 26 ascii [2-7a-z] symbols string of the converted checksum.

Examples

>>> from mendevi.utils import hash_to_signature
>>> hash_to_signature(b"\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04\xe9\x80\t\x98\xec\xf8B~")
'd41d8cd98f00b204e9800998ecf8427e'
>>>