mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-25 01:06:16 -04:00
Replaced 'new Date().getTime()' calls with 'Date.now()' for clarity and performance
This commit is contained in:
parent
9d09146f68
commit
75da5b650c
5 changed files with 12 additions and 12 deletions
4
src/core/vendor/gost/gostRandom.mjs
vendored
4
src/core/vendor/gost/gostRandom.mjs
vendored
|
@ -70,7 +70,7 @@ if (typeof document !== 'undefined') {
|
|||
try {
|
||||
// Mouse move event to fill random array
|
||||
document.addEventListener('mousemove', function (e) {
|
||||
randomRing.set((new Date().getTime() & 255) ^
|
||||
randomRing.set((Date.now() & 255) ^
|
||||
((e.clientX || e.pageX) & 255) ^
|
||||
((e.clientY || e.pageY) & 255));
|
||||
}, false);
|
||||
|
@ -80,7 +80,7 @@ if (typeof document !== 'undefined') {
|
|||
try {
|
||||
// Keypress event to fill random array
|
||||
document.addEventListener('keydown', function (e) {
|
||||
randomRing.set((new Date().getTime() & 255) ^
|
||||
randomRing.set((Date.now() & 255) ^
|
||||
(e.keyCode & 255));
|
||||
}, false);
|
||||
} catch (e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue