just JWT en-/decoding
$ npm i jted
import {encode} from 'jted';
const payload = {
foo: 'bar';
user: 'John Doe',
role: 'moderator'
};
const key = 'change me to a very secure key';
// create token with payload and key
const token = encode(payload, key);
Create a JWT via the payload, key, algorithm and optional options.
Retrieve the payload by decoding token with key and algorithm.
Verify if provided token is legit.
- sha256
- sha384
- sha512
- RSA-SHA256
- check nodejs support for other algorithms
Apache-2.0 License, see LICENSE