fullstackopen-notes/parts/3/phonebookBackend/node_modules/cookie-signature
2025-05-31 22:51:30 +02:00
..
History.md completed exercise 3.1 2025-05-31 22:51:30 +02:00
index.js completed exercise 3.1 2025-05-31 22:51:30 +02:00
LICENSE completed exercise 3.1 2025-05-31 22:51:30 +02:00
package.json completed exercise 3.1 2025-05-31 22:51:30 +02:00
Readme.md completed exercise 3.1 2025-05-31 22:51:30 +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.