Update lib.js
This commit is contained in:
parent
eeb3c70a10
commit
4c6ae601ea
@ -16,5 +16,4 @@ const floGlobals = {
|
|||||||
currency: "rupee"
|
currency: "rupee"
|
||||||
};
|
};
|
||||||
|
|
||||||
(typeof global !== "undefined" ? global : window).cryptocoin = floGlobals.blockchain;
|
|
||||||
('object' === typeof module) ? module.exports = floGlobals: null;
|
('object' === typeof module) ? module.exports = floGlobals: null;
|
||||||
@ -1,3 +1,8 @@
|
|||||||
|
(typeof global !== "undefined" ? global : window).cryptocoin = floGlobals.blockchain;
|
||||||
|
/* Util Libraries required for Standard operations
|
||||||
|
All credits for these codes belong to their respective creators, moderators and owners.
|
||||||
|
For more info on licence for these codes, visit respective source.
|
||||||
|
*/
|
||||||
'use strict';
|
'use strict';
|
||||||
//Crypto.js
|
//Crypto.js
|
||||||
(function(GLOBAL) {
|
(function(GLOBAL) {
|
||||||
@ -398,12 +403,16 @@
|
|||||||
//SecureRandom.js
|
//SecureRandom.js
|
||||||
(function(GLOBAL) {
|
(function(GLOBAL) {
|
||||||
|
|
||||||
var getRandomValues =
|
const getRandomValues = function(buf) {
|
||||||
(typeof require === 'function') ? function(buf) {
|
if (typeof require === 'function') {
|
||||||
var bytes = require('crypto').randomBytes(buf.length)
|
var bytes = require('crypto').randomBytes(buf.length);
|
||||||
buf.set(bytes)
|
buf.set(bytes)
|
||||||
return buf;
|
return buf;
|
||||||
} : (GLOBAL.crypto && GLOBAL.crypto.getRandomValues ? GLOBAL.crypto.getRandomValues : null);
|
} else if (GLOBAL.crypto && GLOBAL.crypto.getRandomValues)
|
||||||
|
return GLOBAL.crypto.getRandomValues(buf);
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Random number generator with ArcFour PRNG
|
* Random number generator with ArcFour PRNG
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user