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;const generate = BetslipIdentity;
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.