gravity-betslip-identity
v1.0.0
Published
Gravity Betslip Identity Parser and Generator
Downloads
11
Maintainers
Readme
Gravity Betslip Identity
This library implemets Gravity Betslip Identity parser and generator.
Using
Library exposes two main static methods:
generate
: Generate hash from idparse
: 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.