JSPM

murmurhash-roku

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q29052F
  • License MIT

BrightScript implementation of MurmurHash

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 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