diff --git a/randombytes.js b/randombytes.js index c19a660..5bdb874 100644 --- a/randombytes.js +++ b/randombytes.js @@ -11,7 +11,7 @@ var randombytes = (function () { } function nodeBytes (out, n) { - out.set(crypto.randomBytes(n)) + new Uint8Array(out.buffer, 0, n).set(crypto.randomBytes(n)) } function noImpl () {