itsdangerous
v0.0.1
Published
Node port of itsdangerous python signer.
Downloads
12
Maintainers
Readme
itsdangerous
Node.js port of python's itsdangerous.
Basic Usage
var nobi = require('nobi');
var signer = nobi('mysecret-no-one-knows');
signer.sign('1');
// 1.T3t+woFyWyguMFMSwqEFS8KjwrvDvyceEQ==
signer.unsign('1.T3t+woFyWyguMFMSwqEFS8KjwrvDvyceEQ==')
// 1
Timestamp Signer Usage
var nobi = require('nobi');
var signer = nobi.timestampSigner('mysecret-no-one-knows');
signer.sign('1');
// 1.MTM4MDA4MDIxODA5MA==.PMO6Pxg/cXFZw4fDilTCkMKGw7zCgF9WWcOvKg==
// Try to unsign with maxAge of 1 second
signer.unsign('1.MTM4MDA4MDIxODA5MA==.PMO6Pxg/cXFZw4fDilTCkMKGw7zCgF9WWcOvKg==',
{ maxAge: 1000 })
// 1