Type aliases
StringHash32Fn
StringHash32Fn: function
Type declaration
-
- (value: string, prevValue?: number): number
-
Parameters
-
value: string
-
Optional prevValue: number
Returns number
Functions
fnv1a32
- fnv1a32(v?: string, prevRes?: number): number
-
Parameters
-
Default value v: string = ""
-
Default value prevRes: number = 0
Returns number
murmur2_32
- murmur2_32(v?: string, prevRes?: number): number
-
Parameters
-
Default value v: string = ""
-
Default value prevRes: number = 0
Returns number
murmur3_32
- murmur3_32(v?: string, prevRes?: number): number
-
Parameters
-
Default value v: string = ""
-
Default value prevRes: number = 0
Returns number
sum32
- sum32(v?: string, prevRes?: number): number
-
Parameters
-
Default value v: string = ""
-
Default value prevRes: number = 0
Returns number
Different hash algorithms
Refferences:
import { fnv1a32, murmur2_32, murmur3_32, sum32 } from '@pencroff/ts-algorithms/dist/algorithm/hash'; const res = fnv1a32('Abc!'); // 157309246