For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
hash_bytes
def hash_bytes[HasherType: Hasher = AHasher[SIMD[.uint64, 4](0)]](bytes: Span[UInt8]) -> UInt64
Hash a sequence of bytes using the specified hasher.
This hashes bytes as a flat byte sequence. It is distinct from
hash(), which hashes a Hashable value: a Span, List or Array
is itself Hashable, so hash(collection) hashes it element-by-element
and produces a different value.
Parameters:
- HasherType (
Hasher): Type of the hasher to use for hashing (default:AHasher).
Args:
- bytes (
Span[UInt8]): The byte sequence to hash.
Returns:
UInt64: A 64-bit integer hash value.