(value)
| 114 | } |
| 115 | |
| 116 | function onInputChange(value) { |
| 117 | if(inputBase === 'bin' && !['0', '1', ''].includes(value.substr(-1))) return; |
| 118 | if(inputBase === 'hex' && !['a', 'b', 'c', 'd', 'e', 'f', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ''].includes(value.substr(-1))) return; |
| 119 | if(clock > lastClock()) setClock(lastClock()); |
| 120 | |
| 121 | setInput(value); |
| 122 | setPaddedInput(padding(value, inputBase)); |
| 123 | |
| 124 | if(clock === 0) value = ''; |
| 125 | let result = shaStepped(value, firstLoop(clock), secondLoop(clock), chunksLoop(clock)); |
| 126 | |
| 127 | setWView(result.w); |
| 128 | setResult(result.hash); |
| 129 | setHs(result.hs); |
| 130 | setHsBefore(result.hsBefore); |
| 131 | setLetters(result.letters); |
| 132 | setLettersBefore(result.lettersBefore); |
| 133 | |
| 134 | ReactGA.event('onInputChange'); |
| 135 | } |
| 136 | |
| 137 | function onClockFast() { |
| 138 | if(clock + 10 > lastClock()) return; |
nothing calls this directly
no test coverage detected