1.0.1 • Published 10 years ago

buffer-equal-constant-time v1.0.1

Weekly downloads
6,917,502
License
BSD-3-Clause
Repository
github
Last release
10 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-1271lib-jwthubot-github-issue-label-notifierhw9isic-githubmongoose-encryptionmongoose-encryption-nestednode-mongoose-alptekin-encryptionnode-mongoose-hybrid-encryptionnode-github-webhookins-sshjwa-wcjsshnative-cryptoneural_compressor_ext_lab_customizedneural_compressor_ext_lab_customized_2mineflayer-auto-totemnpmmdfkvjfdvvmfzkvnpm-lkhgfdfghbjnkmldrfcvbn@soyjak/utils@travi/hapi-github-webhooks@vies.dev/promise-google-sheetsaes-kwavichai@asiz33/smartblok-vendure-pluginbionetbrfv-noteprocappermadeinfutuer@carlostkd7/m3npm-xiaozhenshengnode-sftp-s3node-sftp-s3-ktpassport-mongodbreact-native-video-typozona-xuniversalwrapperwebgme-enginewjxday-9vehicleristretto.gitsgp-ads-test@celadora/password-util@ciro99678_net/node-red-contrib-mssql-rai@ciro99678_net/red-contrib-mssql-raicoderteq_financementorboxegg-github-webhookegg-gitlab-webhook@idrinth/automatic-formattingenefti-galericryptoserverdaijj@agarcian/passwordhash@fusebit/cli@fusebit/everyauth-clidynamics-contracts-x@agneta/platformarvm-bestdeveloperdemo-hfgfhgfghghf@fanfix/nestjs-firebaseexpress-jwt-authenticatorexpress-github-webhook@kunal.p/dwtfired-up-stripegassefals@mattinsler/sshgogs-webhook-handlergit-http-mock-servergocardless-nodejsgitea-webhook-handlergitlab-webhook-handler2gitlab-systemhook-handlergithub-express-webhook-verifyinggitee-webhook-handlergithub-webhook-validatorgithub-webhook-handler-testhmac-authenticationhmac-expresshereditashexo-hook
1.0.1

10 years ago

1.0.0

10 years ago