No matching definitions.

tur/hash

stdlib/hash.tur

canonical integer hashing across numeric widths.

Since: Phase C

defn

hash-int

(hash-int [n : int] :)

hash a 64-bit signed integer via splitmix64 finalizer.

nvalue to hash

A 64-bit hash of n as :int.

(hash-int 42)  ; => some stable 64-bit integer

Since: Phase C

defn

hash-int8

(hash-int8 [n : int8] :)

hash an int8; equals (hash-int (as int n)) via sign-extension.

nint8 value to hash

Same as (hash-int (as int n)).

(= (hash-int8 42i8) (hash-int 42))  ; => true

Since: Phase C

defn

hash-int16

(hash-int16 [n : int16] :)

hash an int16; equals (hash-int (as int n)) via sign-extension.

nint16 value to hash

Same as (hash-int (as int n)).

(= (hash-int16 1000i16) (hash-int 1000))  ; => true

Since: Phase C

defn

hash-int32

(hash-int32 [n : int32] :)

hash an int32; equals (hash-int (as int n)) via sign-extension.

nint32 value to hash

Same as (hash-int (as int n)).

(= (hash-int32 100000i32) (hash-int 100000))  ; => true

Since: Phase C

defn

hash-int64

(hash-int64 [n : int64] :)

hash an int64; identical to hash-int.

nint64 value to hash

Same as (hash-int (as int n)).

(= (hash-int64 42i64) (hash-int 42))  ; => true

Since: Phase C

defn

hash-uint8

(hash-uint8 [n : uint8] :)

hash a uint8 via zero-extension to :int.

nuint8 value to hash

Same as (hash-int (as int n)) where (as int n) zero-extends.

(not= (hash-uint8 255u8) (hash-int -1))  ; => true

Since: Phase C

defn

hash-uint16

(hash-uint16 [n : uint16] :)

hash a uint16 via zero-extension to :int.

nuint16 value to hash

Same as (hash-int (as int n)) where (as int n) zero-extends.

(= (hash-uint16 1000u16) (hash-int 1000))  ; => true

Since: Phase C

defn

hash-uint32

(hash-uint32 [n : uint32] :)

hash a uint32 via zero-extension to :int.

nuint32 value to hash

Same as (hash-int (as int n)) where (as int n) zero-extends.

(= (hash-uint32 1000u32) (hash-int 1000))  ; => true

Since: Phase C

defn

hash-uint64

(hash-uint64 [n : uint64] :)

hash a uint64 by reinterpreting as :int then hashing.

nuint64 value to hash

Hash of the 64-bit bit pattern of n.

(hash-uint64 0u64)  ; => same as (hash-int 0)

Since: Phase C