(data: Uint32Array, length: number)
| 10 | |
| 11 | // convert UTF32 codepoints to string |
| 12 | function toString(data: Uint32Array, length: number): string { |
| 13 | if ((String as any).fromCodePoint) { |
| 14 | return (String as any).fromCodePoint.apply(null, data.subarray(0, length)); |
| 15 | } |
| 16 | let result = ''; |
| 17 | for (let i = 0; i < length; ++i) { |
| 18 | result += stringFromCodePoint(data[i]); |
| 19 | } |
| 20 | return result; |
| 21 | } |
| 22 | |
| 23 | // convert "bytestring" (charCode 0-255) to bytes |
| 24 | function fromByteString(s: string): Uint8Array { |
no test coverage detected