MCPcopy Index your code
hub / github.com/dmarman/sha256algorithm / onClock

Function onClock

src/App.js:91–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89 }
90
91 function onClock() {
92 if(fakeStep === 0 || true) {
93 if (clock < lastClock()) setClock(clock + 1);
94 let result = shaStepped(input, firstLoop(clock), secondLoop(clock), chunksLoop(clock));
95
96 setWView(result.w);
97 setResult(result.hash);
98 setHs(result.hs);
99 setHsBefore(result.hsBefore);
100 setLetters(result.letters);
101 setLettersBefore(result.lettersBefore);
102
103 setFakeStep(fakeStep + 1)
104 }else {
105 setFakeStep(0);
106 }
107
108 setFlash(true);
109 setTimeout(() => {
110 setFlash(false)
111 }, 200)
112
113 ReactGA.event('onClock');
114 }
115
116 function onInputChange(value) {
117 if(inputBase === 'bin' && !['0', '1', ''].includes(value.substr(-1))) return;

Callers 2

App.jsFile · 0.85
onAutoClockFunction · 0.85

Calls 5

lastClockFunction · 0.85
shaSteppedFunction · 0.85
firstLoopFunction · 0.85
secondLoopFunction · 0.85
chunksLoopFunction · 0.85

Tested by

no test coverage detected