Check is a buffer only contains 0s
MIT License
Check is a buffer only contains 0
s
npm install is-zero-buffer
Uses buffer.compare
to be as fast as possible (~20x faster than checking all bytes in a loop)
var isZero = require('is-zero-buffer')
console.log(isZero(someBuffer)) // returns true is someBuffer only contains 0s
var bool = isZero(buffer)
Returns true if a buffer only contains 0
s, false otherwise.
MIT