1.0.0 • Published 6 years ago

gravity-betslip-identity v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

Gravity Betslip Identity

This library implemets Gravity Betslip Identity parser and generator.

Using

Library exposes two main static methods:

  • generate: Generate hash from id
  • parse: Parse id from hash

Example:

const prefix = 'XX';
const salt = 'abcdef0000';

const parse = BetslipIdentity.parse('XX1X8MTTR', salt, prefix);
const generate = BetslipIdentity.generate(1000, salt, prefix);

Both methods return same data:

  • prefix
  • id
  • hash

Running tests

To run unit tests on whole library run:

npm test

Contributing

To contribute to this library, please create pull request against master branch.

Publishing

To publish run command:

npm publish

When publishing, npm will automatically run tests.

It is very important that you set valid version in package before publishing.