@@ -14,9 +14,11 @@
|
||||
"devDependencies": {
|
||||
"@polkadot/dev": "^0.59.19",
|
||||
"@polkadot/util": "^4.0.0-5",
|
||||
"@polkadot/x-randomvalues": "^4.0.0-5",
|
||||
"override-require": "^1.1.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util": "*"
|
||||
"@polkadot/util": "*",
|
||||
"@polkadot/x-randomvalues": "*"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const getRandomValues = require('@polkadot/x-randomvalues').default;
|
||||
|
||||
const { getString, getU8a } = require('./bridge');
|
||||
const getRandomValues = require('./randomvalues');
|
||||
|
||||
const DEFAULT_SELF = { crypto: { getRandomValues } };
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
module.exports = function getRandomValues (arr) {
|
||||
return crypto.getRandomValues(arr);
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const crypto = require('crypto');
|
||||
|
||||
module.exports = function getRandomValues (arr) {
|
||||
return crypto.randomBytes(arr.length).reduce((arr, value, index) => {
|
||||
arr[index] = value;
|
||||
|
||||
return arr;
|
||||
}, arr);
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const getRandomValues = require('./randomvalues-node');
|
||||
|
||||
module.exports = getRandomValues;
|
||||
@@ -1,6 +0,0 @@
|
||||
// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const getRandomValues = require('./randomvalues-node');
|
||||
|
||||
module.exports = getRandomValues;
|
||||
@@ -1846,12 +1846,23 @@ __metadata:
|
||||
dependencies:
|
||||
"@polkadot/dev": ^0.59.19
|
||||
"@polkadot/util": ^4.0.0-5
|
||||
"@polkadot/x-randomvalues": ^4.0.0-5
|
||||
override-require: ^1.1.1
|
||||
peerDependencies:
|
||||
"@polkadot/util": "*"
|
||||
"@polkadot/x-randomvalues": "*"
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/x-randomvalues@npm:^4.0.0-5":
|
||||
version: 4.0.0-6
|
||||
resolution: "@polkadot/x-randomvalues@npm:4.0.0-6"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.1
|
||||
checksum: a19fffec41b330e261354464da21706592b2553dbbde9fe5547f0564051d856a0e1d0664c61c9f00f8a3d308b60a611e2ffa44265c378fe0f1aefaeac2f680aa
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-textdecoder@npm:^4.0.0-5":
|
||||
version: 4.0.0-5
|
||||
resolution: "@polkadot/x-textdecoder@npm:4.0.0-5"
|
||||
|
||||
Reference in New Issue
Block a user