Slash
A fast, efficient hash ported to Javascript.
Usage
const Slash = ; const stringHash = ;const byteHash = ; const stringHash10 = ;const byteHash10 = ;
Slash
can take a string or array of bytes, and will return a 64 bit string hash in base 36. An optional radix
parameter can also be specified (up to 36), and the output will be a string in that radix.
Implementation
The implementation was verified by using the verification technique detailed here. The reason for using strings and having an in-house 64 bit number system is because Javascript can only support bitwise operators on 32 bit numbers. Slash is a hash that returns 64 bit unsigned numbers.
This might be a little slow due to the amount of shifts and a circular rotate, and the fastest version is written in Assembly.
License
Licensed under the MIT License by Kabir Shah.