Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@tinyhttp/cookie-signature

tinyhttp665.9kMIT2.1.1TypeScript support: included

HTTP cookie signing and unsigning

tinyhttp, node.js, web framework, web, backend, static, cookie

readme

@tinyhttp/cookie-signature

npm (scoped) npm

HTTP cookie signing and unsigning. A rewrite of cookie-signature module.

Install

pnpm i @tinyhttp/cookie-signature

API

import { sign, unsign } from '@tinyhttp/cookie-signature'

sign(val, secret)

Signd the given val with secret.

unsign(val, secret)

Unsign and decode the given val with secret, returning false if the signature is invalid.