diff --git a/docs/scripts/floGlobals.js b/docs/scripts/floGlobals.js index 64828d3..2b0b974 100644 --- a/docs/scripts/floGlobals.js +++ b/docs/scripts/floGlobals.js @@ -16,5 +16,4 @@ const floGlobals = { currency: "rupee" }; -(typeof global !== "undefined" ? global : window).cryptocoin = floGlobals.blockchain; ('object' === typeof module) ? module.exports = floGlobals: null; \ No newline at end of file diff --git a/docs/scripts/lib.js b/docs/scripts/lib.js index 83d7ca8..0608f03 100644 --- a/docs/scripts/lib.js +++ b/docs/scripts/lib.js @@ -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'; //Crypto.js (function(GLOBAL) { @@ -398,12 +403,16 @@ //SecureRandom.js (function(GLOBAL) { - var getRandomValues = - (typeof require === 'function') ? function(buf) { - var bytes = require('crypto').randomBytes(buf.length) + const getRandomValues = function(buf) { + if (typeof require === 'function') { + var bytes = require('crypto').randomBytes(buf.length); buf.set(bytes) 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