Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cookie-signature

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cookie-signature

Sign and unsign cookies

  • 1.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27M
decreased by-17.33%
Maintainers
3
Weekly downloads
 
Created

What is cookie-signature?

The cookie-signature package is used to sign and unsign values using a secret key, typically for use in cookie values to prevent tampering. It provides a simple API for signing and verifying strings.

What are cookie-signature's main functionalities?

Sign

This feature allows you to sign a value using a secret key. The result is a signed value that can be used in a cookie or other transport method. The signature is appended to the value with a 's:' prefix.

"signature = require('cookie-signature');\nsignedValue = signature.sign('value', 'secret');"

Unsign

This feature allows you to unsign a previously signed value using the same secret key. If the signature is valid, the original value is returned. If the signature is invalid, a false value is returned, indicating potential tampering.

"signature = require('cookie-signature');\nunsignedValue = signature.unsign('signedValue', 'secret');"

Other packages similar to cookie-signature

Keywords

FAQs

Package last updated on 29 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc