@tinyhttp/cookie-signature

HTTP cookie signing and unsigning

Usage no npm install needed!

<script type="module">
  import tinyhttpCookieSignature from 'https://cdn.skypack.dev/@tinyhttp/cookie-signature';
</script>

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.