mendevi.utils.signature_to_hash

mendevi.utils.signature_to_hash(signature: str) bytes[source]

Convert the string signature into the md5 checksum.

Bijection of hash_to_signature().

Parameters

signaturestr

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

Returns

checksumbytes

The 128 bit binary hash value.

Examples

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