(input, base = 'text')
| 78 | } |
| 79 | |
| 80 | export function padding(input, base = 'text') { |
| 81 | if(base === 'text') input = stringToBinary(input); |
| 82 | if(base === 'hex') input = hexToBinary(input); |
| 83 | let L = input.length; |
| 84 | let K = calculateK(L); |
| 85 | let L64 = return64Bit(decimalToBinary(L)); |
| 86 | |
| 87 | return appendOneBit(input) + L64.padStart(K + 64, '0') |
| 88 | } |
| 89 | |
| 90 | export function paddingExplained(input, base = 'text') { |
| 91 | if(base === 'text') input = stringToBinary(input); |
no test coverage detected