(binary)
| 42 | } |
| 43 | |
| 44 | export function binaryToString(binary) { |
| 45 | let decimal = chunkString(binary, 8).map(value => binaryToDecimal(value)); |
| 46 | let valueArray = new Uint8Array(decimal); |
| 47 | const decoder = new TextDecoder('utf-8'); |
| 48 | |
| 49 | return decoder.decode(valueArray) |
| 50 | } |
| 51 | |
| 52 | export function decimalToBinary(decimal) { |
| 53 | return Number(decimal).toString(2) |
no test coverage detected