bufferutils: add Buffer reverse
This commit is contained in:
parent
33955a7fb5
commit
71d4c78b88
4 changed files with 25 additions and 13 deletions
|
@ -159,11 +159,18 @@ function writeVarInt(buffer, number, offset) {
|
|||
return size
|
||||
}
|
||||
|
||||
function reverse(buffer) {
|
||||
var buffer2 = new Buffer(buffer)
|
||||
Array.prototype.reverse.call(buffer2)
|
||||
return buffer2
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
pushDataSize: pushDataSize,
|
||||
readPushDataInt: readPushDataInt,
|
||||
readUInt64LE: readUInt64LE,
|
||||
readVarInt: readVarInt,
|
||||
reverse: reverse,
|
||||
varIntSize: varIntSize,
|
||||
writePushDataInt: writePushDataInt,
|
||||
writeUInt64LE: writeUInt64LE,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue