This is pretty much a TypeScript rewrite.
Breaking changes
- BREAKING CHANGE: Hashids now throws errors when being constructed with incorrect options (previously, it silently falled back to defaults)
- BREAKING CHANGE: when used from Node (without ESM enabled), you now need to `require('hashids/cjs')`
Features
- transparent support of `BigInt`s. If your environment supports them,
you can use the standard API to encode and decode them.
Note that trying to decode a `BigInt` hashid on an unsupported environment will throw an error.
- lifted the limitation that the alphabet cannot containin spaces
- both the alphabet and salt may now contain multi-byte characters (e.g. for an emoji-based alphabet)
Chores
- upgraded all dependencies
- tests now use `jest` testing framework
- extracted static methods to helper functions
- converted the implementation to TypeScript
- added `prettier`
- added stricter `eslint` rules