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

Function onInputBaseChange

src/App.js:207–235  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

205 }
206
207 function onInputBaseChange(value) {
208 setInputBase(value);
209
210 if(value === 'bin') {
211 if(inputBase === 'text') setInput(stringToBinary(input));
212 if(inputBase === 'hex') setInput(hexToBinary(input));
213 setInputPlaceholderInput('10101...');
214 }
215
216 if(value === 'text') {
217 if(inputBase === 'bin') {
218 setInput(binaryToString(input));
219 if(binaryToString(input) === '\x00') setInput('');
220 };
221
222 if(inputBase === 'hex') {setInput(hexToString(input));}
223
224 setInputPlaceholderInput('Input...');
225 }
226
227 if(value === 'hex') {
228 if(inputBase === 'bin') setInput(binaryToHex(input));
229 if(inputBase === 'text') setInput(stringToHex(input));
230
231 setInputPlaceholderInput('a1b5c8');
232 }
233
234 ReactGA.event('onInputBaseChange');
235 }
236
237 function onClockFinish() {
238 let cyclesCount = paddedInput.length/512;

Callers

nothing calls this directly

Calls 6

stringToBinaryFunction · 0.90
hexToBinaryFunction · 0.90
binaryToStringFunction · 0.90
hexToStringFunction · 0.90
binaryToHexFunction · 0.90
stringToHexFunction · 0.90

Tested by

no test coverage detected