struct

Crysda::HashBuilder

Inherits Struct / Value / Object

Custom Hashing helper. This provides a calculated hash of contents which is consistent on each and every run. This doesn't conflict with and/or override Crystal Hashing functionality which is used for object equality checks. Hash value generated by this builder is only used for internal grouping purposes to ensure the consistency on each and every run/invocation. Refer to CustomColumnValue for more details and usage purposes.

Constants

HASH_NULL = Int64::MAX - 123000

Constructors

Class methods

combine(h1 : Int64, h2 : Int64) : Int64

Combine multiple hash values

Source
hash_bd(val : BigDecimal | Nil, seed : Int64 = 17_i64) : Int64

Hash a single BigDecimal value (or null)

Source
hash_f64(val : Float64 | Nil, seed : Int64 = 17_i64) : Int64

Hash a single Float64 value (or null) - fast path using bit representation

Source
hash_i128(val : Int128 | Nil, seed : Int64 = 17_i64) : Int64

Hash a single Int128 value (or null)

Source
hash_i32(val : Int32 | Nil, seed : Int64 = 17_i64) : Int64

Hash a single Int32 value (or null)

Source
hash_i64(val : Int64 | Nil, seed : Int64 = 17_i64) : Int64

Hash a single Int64 value (or null)

Source
hash_str(val : String | Nil, seed : Int64 = 17_i64) : Int64

Hash a single String value (or null)

Source

Instance methods

add(val : Bool)
Source
add(val : Char)
Source
add(val : String)
Source
add(val : AnyVal)
Source
add(val : Nil)
Source
add(val : Iterable)
Source
add(value : Float32)
Source
add(value : Float64)
Source
add(value : Float)
Source
add(val : Int)
Source
add(val : UUID)
Source
add(val : CustomColumnValue)
Source
add(val)
Source
hashcode(val)
Source
hashcode
Source