-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import farmhash from '.'; | ||
|
||
const testString: string = 'test'; | ||
const testBuffer: Buffer = Buffer.from(testString); | ||
const testSeed1: number = 1; | ||
const testSeed2: number = 2; | ||
|
||
const f32s: number = farmhash.fingerprint32(testString); | ||
const f32b: number = farmhash.fingerprint32(testBuffer); | ||
|
||
const f64s: bigint = farmhash.fingerprint64(testString); | ||
const f64b: bigint = farmhash.fingerprint64(testBuffer); | ||
|
||
const f64ss: bigint = farmhash.fingerprint64signed(testString); | ||
const f64sb: bigint = farmhash.fingerprint64signed(testBuffer); | ||
|
||
const h32s: number = farmhash.hash32(testString); | ||
const h32b: number = farmhash.hash32(testBuffer); | ||
|
||
const h32ss: number = farmhash.hash32WithSeed(testString, testSeed1); | ||
const h32sb: number = farmhash.hash32WithSeed(testBuffer, testSeed1); | ||
|
||
const h64s: bigint = farmhash.hash64(testString); | ||
const h64b: bigint = farmhash.hash64(testBuffer); | ||
|
||
const h64ss: bigint = farmhash.hash64WithSeed(testString, testSeed1); | ||
const h64sb: bigint = farmhash.hash64WithSeed(testBuffer, testSeed1); | ||
|
||
const h64sss: bigint = farmhash.hash64WithSeeds(testString, testSeed1, testSeed2); | ||
const h64ssb: bigint = farmhash.hash64WithSeeds(testBuffer, testSeed1, testSeed2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters