(hex: Hex, opts: HexToStringOpts = {})
| 258 | * // 'Hello world' |
| 259 | */ |
| 260 | export function hexToString(hex: Hex, opts: HexToStringOpts = {}): string { |
| 261 | let bytes = hexToBytes(hex) |
| 262 | if (opts.size) { |
| 263 | assertSize(bytes, { size: opts.size }) |
| 264 | bytes = trim(bytes, { dir: 'right' }) |
| 265 | } |
| 266 | return new TextDecoder().decode(bytes) |
| 267 | } |
no test coverage detected