This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 | |
height: 600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
class Point extends Array{ | |
constructor(x,y,ord){ | |
super(); | |
if(Array.isArray(x)){ | |
ord = x[2]; | |
y = x[1]; | |
x = x[0]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
JSON.clone = JSON.clone || function(o){ | |
let obj = JSON.stringify(o); | |
if(typeof obj === 'undefined'){ | |
return undefined; | |
} | |
obj = JSON.parse(obj); | |
return obj; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Flatten nested arrays. | |
* | |
* @param {array} arr - The nested array to be flattened | |
* @param {number} failsafe - (Optional) In case of extreme depth, simply stops the recursion | |
*/ | |
function FlattenArray(arr, failsafe){ | |
if(typeof failsafe === 'undefined'){ | |
failsafe = Number.MAX_SAFE_INTEGER; | |
//failsafe = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* EXAMPLE | |
* var myhash = CryptoJS.HmacSHA1(mine[2], secret); | |
* myhash = byteArrayConversion(myhash); | |
*/ | |
function wordArrayToByteArray(hash){ | |
return hash.words | |
//map each word to an array of bytes | |
.map(function(v){ | |
// create an array of 4 bytes (less if sigBytes says we have run out) |