(hex)
| 17 | } |
| 18 | |
| 19 | export function hexToString(hex) { |
| 20 | let decimal = chunkString(hex, 2).map(value => parseInt(value, 16)); |
| 21 | |
| 22 | let valueArray = new Uint8Array(decimal); |
| 23 | const decoder = new TextDecoder('utf-8'); |
| 24 | |
| 25 | return decoder.decode(valueArray) |
| 26 | } |
| 27 | |
| 28 | export function stringToHex(string) { |
| 29 | const encoder = new TextEncoder(); |
no test coverage detected