farmhash.wasm
WebAssembly implementation of Google FarmHash. This module began life as a quasi-fork of the farmhash module.
Basic Usage
'use strict';const hash32 hash32WithSeed hash64 hash64WithSeed hash64WithSeeds fingerprint32 fingerprint64 } = ; console;console;console;console;console;console;console;console;console;console;console;console;console;console;
API
farmhash.wasm
exports the following methods.
hash32(input)
- Arguments
input
(string or Buffer) - Value to be hashed.
- Returns
result
(number) - A 32-bit unsigned integer hash value ofinput
.
hash32WithSeed(input, seed)
- Arguments
input
(string or Buffer) - Value to be hashed.seed
(integer) - Number to use as a seed.
- Returns
result
(number) - A 32-bit unsigned integer hash value ofinput
.
hash64(input)
- Arguments
input
(string or Buffer) - Value to be hashed.
- Returns
result
(string) - A string representation of a 64-bit unsigned integer hash value ofinput
.
hash64WithSeed(input, seed)
- Arguments
input
(string or Buffer) - Value to be hashed.seed
(integer) - Number to use as a seed.
- Returns
result
(string) - A string representation of a 64-bit unsigned integer hash value ofinput
.
hash64WithSeeds(input, seed1, seed2)
- Arguments
input
(string or Buffer) - Value to be hashed.seed1
andseed2
(integer) - Numbers to use as a seed.
- Returns
result
(string) - A string representation of a 64-bit unsigned integer hash value ofinput
.
fingerprint32(input)
- Arguments
input
(string or Buffer) - Value to fingerprint.
- Returns
result
(number) - A 32-bit unsigned integer fingerprint value ofinput
.
fingerprint64(input)
- Arguments
input
(string or Buffer) - Value to fingerprint.
- Returns
result
(number) - A string representation of a 64-bit unsigned integer fingerprint value ofinput
.