FNV-1a non-cryptographic hash function.
npm install @denox/fnv1aFNV-1a is a fast non-cryptographic hash function with great distribution rare collisions.
``ts`
import fnv1a from "https://deno.land/x/fnv1a/mod.ts";
This is a port of @sindresorhus/fnv1a, through the code is slightly by using the newer TextEncoder standard.
`js
import fnv1a from "@denox/fnv1a";
fnv1a("๐ฆ๐", { size: 32 });
//=> 2_868_248_295n
fnv1a("๐ฆ๐", { size: 128 });
//=> 13_487_074_350_300_261_116_944_693_128_525_960_095n
Number(fnv1a("๐ฆ๐", { size: 32 }));
//=> 2_868_248_295
`
Returns the hash as a positive BigInt.
If you need it as a number, use 32 as size and wrap the return value in Number(โฆ).
#### options
Type: object
##### size
Type: number\32 | 64 | 128 | 256 | 512 | 1024
Values: \32`
Default:
The bit size of the hash.