UNPKG

427 BMarkdownView Raw
1
2# cookie-signature
3
4 Sign and unsign cookies.
5
6## Example
7
8```js
9var cookie = require('cookie-signature');
10
11var val = cookie.sign('hello', 'tobiiscool');
12val.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI');
13
14var val = cookie.sign('hello', 'tobiiscool');
15cookie.unsign(val, 'tobiiscool').should.equal('hello');
16cookie.unsign(val, 'luna').should.be.false;
17```
18
19## License
20
21MIT.
22
23See LICENSE file for details.