1.0.1 • Published 11 years ago

buffer-equal-constant-time v1.0.1

Weekly downloads
6,917,502
License
BSD-3-Clause
Repository
github
Last release
11 years ago

buffer-equal-constant-time

Constant-time Buffer comparison for node.js. Should work with browserify too.

Build Status

  npm install buffer-equal-constant-time

Usage

  var bufferEq = require('buffer-equal-constant-time');

  var a = new Buffer('asdf');
  var b = new Buffer('asdf');
  if (bufferEq(a,b)) {
    // the same!
  } else {
    // different in at least one byte!
  }

If you'd like to install an .equal() method onto the node.js Buffer and SlowBuffer prototypes:

  require('buffer-equal-constant-time').install();

  var a = new Buffer('asdf');
  var b = new Buffer('asdf');
  if (a.equal(b)) {
    // the same!
  } else {
    // different in at least one byte!
  }

To get rid of the installed .equal() method, call .restore():

  require('buffer-equal-constant-time').restore();

Legal

© 2013 GoInstant Inc., a salesforce.com company

Licensed under the BSD 3-clause license.

jwapoint-api-servicehapi-github-webhooksopenid-passport@iobroker-community-adapters/iobroker.device-watcherhexa-node-common@infinitebrahmanuniverse/nolb-buf@prodam/prodam-typesexpress-api-pack-tr@everything-registry/sub-chunk-1271wjxday-9vehicleisic-githubjsshjwa-wc@asiz33/smartblok-vendure-plugin@agarcian/passwordhash@agneta/platform@carlostkd7/m3@celadora/password-util@ciro99678_net/node-red-contrib-mssql-rai@ciro99678_net/red-contrib-mssql-raizona-xwebgme-engineuniversalwrapper@fusebit/cli@fusebit/everyauth-cli@kunal.p/dwt@fanfix/nestjs-firebase@mattinsler/ssh@idrinth/automatic-formatting@sabihnaqvi/common-utilities@soyjak/utilsmongoose-encryption-nestedmongoose-encryptionmineflayer-auto-totemnative-cryptonpm-xiaozhenshengnpmmdfkvjfdvvmfzkvpassport-mongodbpanzx-storereact-native-video-typonode-github-webhooknode-mongoose-hybrid-encryptionnode-mongoose-alptekin-encryptionneural_compressor_ext_lab_customizedneural_compressor_ext_lab_customized_2node-sftp-s3-ktnode-sftp-s3npm-lkhgfdfghbjnkmldrfcvbnristretto.gitqwerty-0xsgp-ads-testskola77-apishowgallerygogs-webhook-handlergit-http-mock-servergitee-webhook-handlergitlab-systemhook-handlergitlab-webhook-handler2github-express-webhook-verifyinggitea-webhook-handlergithub-webhook-handler-testgithub-webhook-validatorhw9hubot-github-issue-label-notifierhmac-authenticationhmac-expresshexo-hookhereditasins-sshlib-jwtloading-animatedkthakrar-library@travi/hapi-github-webhooks@vies.dev/promise-google-sheetsaes-kwavichaiarvm-bestdevelopercappermadeinfutuercoderteq_financementorboxcryptoserverdaijjdemo-hfgfhgfghghfbionetbrfv-noteprodynamics-contracts-xegg-github-webhookegg-gitlab-webhookenefti-galeriexpress-github-webhookexpress-jwt-authenticatorfired-up-stripegassefalsgassefals-2
1.0.1

11 years ago

1.0.0

11 years ago