package core.hash
hash :: (key: rawptr) -> u32
hash :: (p: Pair($First_Type, $Second_Type)) -> #auto
where hash.Hashable(First_Type), hash.Hashable(Second_Type)
hash :: (key: i8) -> u32
hash :: (key: i16) -> u32
hash :: (key: i32) -> u32
hash :: (key: i64) -> u32
hash :: (key: [] u8) -> u32
hash :: (key: type_expr) -> u32
hash :: (key: bool) -> u32
hash :: (key: $T) -> u32
where type_is_enum(T)
hash :: macro (key: $T) -> #auto
where HasHashMethod(T)
This overloaded procedure defines how to hash something. It is used throughout the standard library to hash values. There are many overloads to it in the standard library, and more can be added using #overload.
Alternatively, a hash method can be defined for a structure or distinct type.
Person :: struct {
hash :: (p: Person) -> u32 {
return // ...
}
}