Tokenize for Node.js
Installation
With PNPM:
pnpm i node-tokenize
With Yarn:
yarn add node-tokenize
With NPM:
npm i node-tokenize
How to use it
const tokenize = 'Very strong and secure secret' console // xxxxxxxx.xxxxxxxxxxx.xxxxxxxxxconsole // prefix.xxxxxxxx.xxxxxxxxxxx.xxxxxxxxx // Returns the account, or null if the token is invalidconsole // Get an OTP keyconsole // You just need to save the base32 key in database // Validate an OTP codeconsoleconsole
For specifications about how to use Tokenize in general, please refer to the top-level README.
Looking to use this in a Fastify application? Give fastify-tokenize a look! :D
TODO
- Make it available to the web (through Web Crypto eventually)
License
Like all official Tokenize implementation, this implementation is released under the BSD-3-Clause license.