Search code examples
pythoncryptographyhashlib

Python – hashlib.blake2b-256/512?


I often see references to multiple types of blake2b– a 256-bit version, a 512-bit version, and so on. What version is hashlib.blake2b()? I don't see any mentions of it.

hashlib.blake2b(data=b'', *, digest_size=64, key=b'', salt=b'', person=b'', fanout=1, depth=1, leaf_size=0, node_offset=0, node_depth=0, inner_size=0, last_node=False)

Solution

  • From the docs

    hashlib.blake2b(data=b'', *, digest_size=64, key=b'', salt=b'', person=b'', fanout=1, depth=1, leaf_size=0, node_offset=0, node_depth=0, inner_size=0, last_node=False)
    

    The default digest_size is 64 bytes (512 bits)