Skip to content
This repository was archived by the owner on Jan 23, 2021. It is now read-only.

sindresorhus/buffer-equals

buffer-equals Build Status

Node.js buffer.equals() ponyfill

Deprecated: Just use Buffer#equals(). It has been available since Node.js 0.12.

Install

$ npm install --save buffer-equals

Usage

const bufferEquals = require('buffer-equals');

bufferEquals(new Buffer('foo'), new Buffer('foo'));
//=> true

bufferEquals(new Buffer('foo'), new Buffer('bar'));
//=> false

API

See the buffer.equals() docs.

The only difference is that you pass in the buffer as the first argument instead of calling the .equals() method on the buffer instance.

Related

License

MIT © Sindre Sorhus

About

Node.js 0.12 buffer.equals() ponyfill

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published