HckApm/node_modules/cookie-signature
minicx 99e5f883a3 second commit 2023-12-23 14:56:27 +03:00
..
History.md second commit 2023-12-23 14:56:27 +03:00
LICENSE second commit 2023-12-23 14:56:27 +03:00
Readme.md second commit 2023-12-23 14:56:27 +03:00
index.js second commit 2023-12-23 14:56:27 +03:00
package.json second commit 2023-12-23 14:56:27 +03:00

Readme.md

cookie-signature

Sign and unsign cookies.

Example

var cookie = require('cookie-signature');

var val = cookie.sign('hello', 'tobiiscool');
val.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI');

var val = cookie.sign('hello', 'tobiiscool');
cookie.unsign(val, 'tobiiscool').should.equal('hello');
cookie.unsign(val, 'luna').should.be.false;

License

MIT.

See LICENSE file for details.