iching-broker-level2/node_modules/cookie-signature
Christopher Hase 9aeeb95994
Some checks are pending
ci / build (push) Waiting to run
add http-server part 5.9
2025-04-09 16:12:34 +02:00
..
History.md add http-server part 5.9 2025-04-09 16:12:34 +02:00
index.js add http-server part 5.9 2025-04-09 16:12:34 +02:00
LICENSE add http-server part 5.9 2025-04-09 16:12:34 +02:00
package.json add http-server part 5.9 2025-04-09 16:12:34 +02:00
Readme.md add http-server part 5.9 2025-04-09 16:12:34 +02:00

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.