$ npm install buffer-reverse
A lite module for byte reverse on buffers.
var reverse = require("buffer-reverse")
var a = new Buffer('00ff0f', 'hex')
console.log(reverse(a))
// => <Buffer 0f ff 00>
Or for those seeking those few extra cycles, perform the operation in place:
var reverseInplace = require("buffer-reverse/inplace")
var a = new Buffer('00ff0f', 'hex')
console.log(reverseInplace(a))
// => <Buffer 0f ff 00>
// See that a has been mutated
console.log(a)
// => <Buffer 0f ff 00>
© 2010 - cnpmjs.org x YWFE | Home | YWFE