Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (murmurhash-roku) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
murmurhash-roku
BrightScript implementation of MurmurHash
The implementation is based on the following definition: https://en.wikipedia.org/wiki/MurmurHash#Algorithm
Installation
with kopytko-packager
When using kopytko-packager you can simly define this package as a dependecy.
npm i murmurhash-roku
without kopytko-packager
Copy MurmurHash.brs file from this repository to your project.
Remember that it uses also the getType function from the kopytko-utils, so copy it along with it, or create a similar one.
Usage
' @import /components/libs/MurmurHash.brs from murmurhash-roku
function get123Hash() as LongInteger
return MurmurHash().v3("123", 1)
end functionDocumentation
Currently, there is only one hash method - v3. It generates MurmurHash v3. As Brightscript has only 32 or 64 signed values (Integer and LongInteger) this supports only 32-bit generation.
MurmurHash().v3(key, seed)
params:
- key - String or ByteArray to be hashed
- seed - accepts LongInteger, but it can be also an Integer
returns: (LongInteger) hashed value LongInteger value hash