This file contains hidden or 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
| var tests = 1000; | |
| var i = 0; | |
| var t0 = performance.now(); | |
| while (i < tests) { | |
| functionOne() | |
| i++; | |
| } | |
| var t1 = performance.now(); | |
| console.log("Call to test 1 took " + (t1 - t0) + " milliseconds."); |
This file contains hidden or 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
| var decrypt = function (encrypted, method, secret, hmac) { | |
| var iv = new Buffer.from(encrypted.substr(0, 24), "base64").toString(); | |
| var decryptor = crypto.createDecipheriv(method, secret, iv); | |
| return ( | |
| decryptor.update(encrypted.substr(24), "base64", "utf8") + | |
| decryptor.final("utf8") | |
| ); | |
| }; |
OlderNewer