murmurhash-roku

1.0.0 • Public • Published

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 function

Documentation

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

Package Sidebar

Install

npm i murmurhash-roku

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

6.57 kB

Total Files

4

Last publish

Collaborators

  • blazej.chelkowski