UNPKG
shuffle-buffer
Version:
latest (1.0.1)
1.0.1
1.0.0
shuffle buffer
github.com/jbenet/node-shuffle-buffer
jbenet/node-shuffle-buffer
shuffle-buffer
/
index.js
9 lines
(6 loc)
•
198 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
var
shuffle =
require
(
'lodash.shuffle'
)
module
.
exports
=
function
(
buf
) {
if
(!(buf
instanceof
Buffer
))
throw
new
Error
(
'buf should be a Buffer'
)
return
new
Buffer
(
shuffle
(buf.
toJSON
())) }