Name: buffer-reverse
Owner: crypto-browserify
Description: A lite module for byte reversal on buffers.
Created: 2015-09-25 07:24:10.0
Updated: 2017-07-22 01:07:17.0
Pushed: 2017-08-03 12:54:46.0
Size: 6
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A lite module for byte reverse on buffers.
reverse = require('buffer-reverse')
a = new Buffer('00ff0f', 'hex')
ole.log(reverse(a))
> <Buffer 0f ff 00>
Or for those seeking those few extra cycles, perform the operation in place:
reverseInplace = require('buffer-reverse/inplace')
a = new Buffer('00ff0f', 'hex')
ole.log(reverseInplace(a))
> <Buffer 0f ff 00>
ee that a has been mutated
ole.log(a)
> <Buffer 0f ff 00>