Revert "bufferutils: remove equal, use Buffer.compare"
This reverts commit 75540b6116
.
See discussion in https://github.com/bitcoinjs/bitcoinjs-lib/pull/410
This commit is contained in:
parent
f64df79555
commit
d7019e7492
2 changed files with 13 additions and 2 deletions
|
@ -168,6 +168,16 @@ function varIntBuffer (i) {
|
|||
return buffer
|
||||
}
|
||||
|
||||
function equal (a, b) {
|
||||
if (a.length !== b.length) return false
|
||||
|
||||
for (var i = 0; i < a.length; ++i) {
|
||||
if (a[i] !== b[i]) return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
function reverse (buffer) {
|
||||
var buffer2 = new Buffer(buffer)
|
||||
Array.prototype.reverse.call(buffer2)
|
||||
|
@ -175,6 +185,7 @@ function reverse (buffer) {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
equal: equal,
|
||||
pushDataSize: pushDataSize,
|
||||
readPushDataInt: readPushDataInt,
|
||||
readUInt64LE: readUInt64LE,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue