(b: number): (self: number) => number
(self: number, b: number): numberCombines two hash values into a single hash value.
When to use
Use to build a hash for a composite value by folding together hash values for its parts.
Details
Supports both direct and pipeable usage. The implementation combines two
hash values with (self * 53) ^ b.
Example (Combining hash values)
import { Hash, pipe } from "effect"
// Can also be used with pipe
const hash1 = Hash.hash("hello")
const hash2 = Hash.hash("world")
// Combine two hash values
const combined = Hash.combine(hash2)(hash1)
console.log(combined)
const result = pipe(hash1, Hash.combine(hash2))Source effect/Hash.ts:2374 lines
export const const combine: {
(b: number): (self: number) => number
(self: number, b: number): number
}
Combines two hash values into a single hash value.
When to use
Use to build a hash for a composite value by folding together hash values for
its parts.
Details
Supports both direct and pipeable usage. The implementation combines two
hash values with (self * 53) ^ b.
Example (Combining hash values)
import { Hash, pipe } from "effect"
// Can also be used with pipe
const hash1 = Hash.hash("hello")
const hash2 = Hash.hash("world")
// Combine two hash values
const combined = Hash.combine(hash2)(hash1)
console.log(combined)
const result = pipe(hash1, Hash.combine(hash2))
combine: {
(b: numberb: number): (self: numberself: number) => number
(self: numberself: number, b: numberb: number): number
} = import dualdual(2, (self: numberself: number, b: numberb: number): number => (self: numberself * 53) ^ b: numberb)Referenced by 1 symbols