Files
portfolio/node_modules/.cache/babel-loader/699c668c5a30e4e46475e8eb1fd0b3fd.json
2021-09-20 16:54:47 -04:00

1 line
5.3 KiB
JSON

{"ast":null,"code":"var r;\n\nmodule.exports = function rand(len) {\n if (!r) r = new Rand(null);\n return r.generate(len);\n};\n\nfunction Rand(rand) {\n this.rand = rand;\n}\n\nmodule.exports.Rand = Rand;\n\nRand.prototype.generate = function generate(len) {\n return this._rand(len);\n}; // Emulate crypto API using randy\n\n\nRand.prototype._rand = function _rand(n) {\n if (this.rand.getBytes) return this.rand.getBytes(n);\n var res = new Uint8Array(n);\n\n for (var i = 0; i < res.length; i++) res[i] = this.rand.getByte();\n\n return res;\n};\n\nif (typeof self === 'object') {\n if (self.crypto && self.crypto.getRandomValues) {\n // Modern browsers\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.crypto.getRandomValues(arr);\n return arr;\n };\n } else if (self.msCrypto && self.msCrypto.getRandomValues) {\n // IE\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.msCrypto.getRandomValues(arr);\n return arr;\n }; // Safari's WebWorkers do not have `crypto`\n\n } else if (typeof window === 'object') {\n // Old junk\n Rand.prototype._rand = function () {\n throw new Error('Not implemented yet');\n };\n }\n} else {\n // Node.js or Web worker with no crypto support\n try {\n var crypto = require('crypto');\n\n if (typeof crypto.randomBytes !== 'function') throw new Error('Not supported');\n\n Rand.prototype._rand = function _rand(n) {\n return crypto.randomBytes(n);\n };\n } catch (e) {}\n}","map":{"version":3,"sources":["/Users/tylerkoenig/Code/personal/react-scss2/node_modules/brorand/index.js"],"names":["r","module","exports","rand","len","Rand","generate","prototype","_rand","n","getBytes","res","Uint8Array","i","length","getByte","self","crypto","getRandomValues","arr","msCrypto","window","Error","require","randomBytes","e"],"mappings":"AAAA,IAAIA,CAAJ;;AAEAC,MAAM,CAACC,OAAP,GAAiB,SAASC,IAAT,CAAcC,GAAd,EAAmB;AAClC,MAAI,CAACJ,CAAL,EACEA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AAiBJ,IAAI,CAACI,QAAL,CAAcF,eAAnC,EAAoD;AACzD;AACAb,IAAAA,IAAI,CAACE,SAAL,CAAeC,KAAf,GAAuB,SAASA,KAAT,CAAeC,CAAf,EAAkB;AACvC,UAAIU,GAAG,GAAG,IAAIP,UAAJ,CAAeH,CAAf,CAAV;AACAO,MAAAA,IAAI,CAACI,QAAL,CAAcF,eAAd,CAA8BC,GAA9B;AACA,aAAOA,GAAP;AACD,KAJD,CAFyD,CAQ3D;;AACC,GATM,MASA,IAAI,OAAOE,MAAP,KAAkB,QAAtB,EAAgC;AACrC;AACAhB,IAAAA,IAAI,CAACE,SAAL,CAAeC,KAAf,GAAuB,YAAW;AAChC,YAAM,IAAIc,KAAJ,CAAU,qBAAV,CAAN;AACD,KAFD;AAGD;AACF,CAvBD,MAuBO;AACL;AACA,MAAI;AACF,QAAIL,MAAM,GAAGM,OAAO,CAAC,QAAD,CAApB;;AACA,QAAI,OAAON,MAAM,CAACO,WAAd,KAA8B,UAAlC,EACE,MAAM,IAAIF,KAAJ,CAAU,eAAV,CAAN;;AAEFjB,IAAAA,IAAI,CAACE,SAAL,CAAeC,KAAf,GAAuB,SAASA,KAAT,CAAeC,CAAf,EAAkB;AACvC,aAAOQ,MAAM,CAACO,WAAP,CAAmBf,CAAnB,CAAP;AACD,KAFD;AAGD,GARD,CAQE,OAAOgB,CAAP,EAAU,CACX;AACF","sourcesContent":["var r;\n\nmodule.exports = function rand(len) {\n if (!r)\n r = new Rand(null);\n\n return r.generate(len);\n};\n\nfunction Rand(rand) {\n this.rand = rand;\n}\nmodule.exports.Rand = Rand;\n\nRand.prototype.generate = function generate(len) {\n return this._rand(len);\n};\n\n// Emulate crypto API using randy\nRand.prototype._rand = function _rand(n) {\n if (this.rand.getBytes)\n return this.rand.getBytes(n);\n\n var res = new Uint8Array(n);\n for (var i = 0; i < res.length; i++)\n res[i] = this.rand.getByte();\n return res;\n};\n\nif (typeof self === 'object') {\n if (self.crypto && self.crypto.getRandomValues) {\n // Modern browsers\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.crypto.getRandomValues(arr);\n return arr;\n };\n } else if (self.msCrypto && self.msCrypto.getRandomValues) {\n // IE\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.msCrypto.getRandomValues(arr);\n return arr;\n };\n\n // Safari's WebWorkers do not have `crypto`\n } else if (typeof window === 'object') {\n // Old junk\n Rand.prototype._rand = function() {\n throw new Error('Not implemented yet');\n };\n }\n} else {\n // Node.js or Web worker with no crypto support\n try {\n var crypto = require('crypto');\n if (typeof crypto.randomBytes !== 'function')\n throw new Error('Not supported');\n\n Rand.prototype._rand = function _rand(n) {\n return crypto.randomBytes(n);\n };\n } catch (e) {\n }\n}\n"]},"metadata":{},"sourceType":"script"}