Mojo module
hash
Implements the Hashable trait and hash() built-in function.
There are a few main tools in this module:
Hashabletrait for types implementing__hash__(self) -> UInthash[T: Hashable](hashable: T) -> Intbuilt-in function.- A
hash()implementation for arbitrary byte strings,hash(data: UnsafePointer[UInt8], n: Int) -> Int, is the workhorse function, which implements efficient hashing via SIMD vectors. See the documentation of this function for more details on the hash implementation. hash(SIMD)andhash(UInt8)implementations These are useful helpers to specialize for the general bytes implementation.
Traitsβ
- β
Hashable: A trait for types which specify a function to hash their data.
Functionsβ
- β
hash: Hash a Hashable type using its underlying hash implementation.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!