1.0.1 • Published 12 years ago

buffer-equal-constant-time v1.0.1

Weekly downloads
6,917,502
License
BSD-3-Clause
Repository
github
Last release
12 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-wchw9hubot-github-issue-label-notifierhmac-authenticationhmac-expresshexo-hookhereditasins-sshlib-jwtloading-animatedkthakrar-library@travi/hapi-github-webhooks@vies.dev/promise-google-sheetsaes-kwavichaiarvm-bestdeveloperzona-xwebgme-engineuniversalwrapper@kunal.p/dwtmongoose-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-validator@idrinth/automatic-formatting@fanfix/nestjs-firebase@fusebit/cli@fusebit/everyauth-cligassefalsgassefals-2dynamics-contracts-xegg-github-webhookegg-gitlab-webhookenefti-galeriexpress-github-webhookexpress-jwt-authenticatorfired-up-stripe@bnz-org/mdtex-parser@brianbrinkerhoff/authtokenpackage@carlostkd7/m3@celadora/password-util@ciro99678_net/node-red-contrib-mssql-rai@ciro99678_net/red-contrib-mssql-raicappermadeinfutuercoderteq_financementorboxcryptoserverdaijjdemo-hfgfhgfghghfbionetbrfv-notepro@agarcian/passwordhash@ahmeducf/s-jwt@agneta/platform@asiz33/smartblok-vendure-plugin@myscada/embedjs@kb0912/medusa-sapo-plugin-v2@mattinsler/ssh@sabihnaqvi/common-utilities@soyjak/utils
1.0.1

12 years ago

1.0.0

12 years ago