Bump wasm-crypto (#745)
* Bump wasm-crypto * Use x-randomvalues for randomAsU8a
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2020 @polkadot/util-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import nacl from 'tweetnacl';
|
||||
import getRandomValues from '@polkadot/x-randomvalues';
|
||||
|
||||
/**
|
||||
* @name randomAsU8a
|
||||
@@ -18,5 +18,5 @@ import nacl from 'tweetnacl';
|
||||
* ```
|
||||
*/
|
||||
export default function randomAsU8a (length = 32): Uint8Array {
|
||||
return nacl.randomBytes(length);
|
||||
return getRandomValues(new Uint8Array(length));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user