1.0.1 • Published 7 years ago

is-zero-buffer v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

is-zero-buffer

Check is a buffer only contains 0s

npm install is-zero-buffer

build status

Uses buffer.compare to be as fast as possible (~20x faster than checking all bytes in a loop)

Usage

var isZero = require('is-zero-buffer')

console.log(isZero(someBuffer)) // returns true is someBuffer only contains 0s

API

var bool = isZero(buffer)

Returns true if a buffer only contains 0s, false otherwise.

License

MIT