struct
Crysda::HashBuilder
- Crysda::HashBuilder
- Struct
- Value
- Object
Overview
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.
Defined in:
crysda/utils.crConstant Summary
-
HASH_NULL =
Int64::MAX - 123000
Constructors
Class Method Summary
-
.combine(h1 : Int64, h2 : Int64) : Int64
Combine multiple hash values
-
.hash_f64(val : Float64 | Nil, seed : Int64 = 17_i64) : Int64
Hash a single Float64 value (or null) - fast path using bit representation
-
.hash_i32(val : Int32 | Nil, seed : Int64 = 17_i64) : Int64
Hash a single Int32 value (or null)
-
.hash_i64(val : Int64 | Nil, seed : Int64 = 17_i64) : Int64
Hash a single Int64 value (or null)
-
.hash_str(val : String | Nil, seed : Int64 = 17_i64) : Int64
Hash a single String value (or null)
Instance Method Summary
- #add(val : Bool)
- #add(val : Char)
- #add(val : String)
- #add(val : AnyVal)
- #add(val : Nil)
- #add(val : Iterable)
- #add(value : Float32)
- #add(value : Float64)
- #add(value : Float)
- #add(val : Int)
- #add(val : UUID)
- #add(val : CustomColumnValue)
- #add(val)
- #hashcode(val)
- #hashcode : Int64
Constructor Detail
Class Method Detail
Hash a single Float64 value (or null) - fast path using bit representation
Hash a single Int32 value (or null)
Hash a single Int64 value (or null)
Hash a single String value (or null)