mirror of
https://github.com/gchq/CyberChef
synced 2025-12-15 07:43:22 +00:00
Calls to window and document in src/core/ no longer break non-browser environments
This commit is contained in:
@@ -17,7 +17,7 @@ const UUID = {
|
||||
* @returns {string}
|
||||
*/
|
||||
runGenerateV4: function(input, args) {
|
||||
if (typeof(window.crypto) !== "undefined" && typeof(window.crypto.getRandomValues) !== "undefined") {
|
||||
if (window && typeof(window.crypto) !== "undefined" && typeof(window.crypto.getRandomValues) !== "undefined") {
|
||||
var buf = new Uint32Array(4),
|
||||
i = 0;
|
||||
window.crypto.getRandomValues(buf);
|
||||
|
||||
Reference in New Issue
Block a user