Socket
Socket
Sign inDemoInstall

scmp

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scmp

safe, constant-time string-comparison


Version published
Weekly downloads
1.1M
decreased by-16.26%
Maintainers
1
Weekly downloads
 
Created

What is scmp?

The scmp package in npm is a secure, constant-time comparison of strings or buffers. It is primarily used to prevent timing attacks when comparing sensitive data, such as cryptographic hashes or tokens.

What are scmp's main functionalities?

Secure String Comparison

This feature allows for the secure comparison of two strings, ensuring that the time taken to compare is constant, thus preventing timing attacks.

const scmp = require('scmp');
const a = 'not_so_secret';
const b = 'not_so_secret';
console.log(scmp(a, b)); // outputs: true

Secure Buffer Comparison

Similar to string comparison, this feature enables the secure, constant-time comparison of two buffers, which is useful for comparing binary data securely.

const scmp = require('scmp');
const buffer1 = Buffer.from('secret_data');
const buffer2 = Buffer.from('secret_data');
console.log(scmp(buffer1, buffer2)); // outputs: true

Other packages similar to scmp

Keywords

FAQs

Package last updated on 04 Nov 2014

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