Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #95 from mitar/fix-random
Browse files Browse the repository at this point in the history
Buffer to getRandomValues does not have to be only Uint8Array
  • Loading branch information
rmhrisk committed Feb 27, 2017
2 parents 61dd1fc + 82f4eca commit 4a5b25e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/webcrypto.ts
Expand Up @@ -50,7 +50,7 @@ class WebCrypto implements NativeCrypto {
throw error;
}
const bytes = crypto.randomBytes(array.byteLength);
(array as Uint8Array).set(bytes);
(array as Uint8Array).set(new (<typeof Uint8Array>array.constructor)(bytes.buffer));
return array;
}

Expand Down

0 comments on commit 4a5b25e

Please sign in to comment.