(bytes: Uint8Array, utf8: boolean)
| 825 | "≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " |
| 826 | |
| 827 | const decodeName = (bytes: Uint8Array, utf8: boolean): string => { |
| 828 | if (utf8) return textDecoder.decode(bytes) |
| 829 | try { |
| 830 | return strictTextDecoder.decode(bytes) |
| 831 | } catch { |
| 832 | let name = "" |
| 833 | for (let i = 0; i < bytes.length; i++) { |
| 834 | name += bytes[i] < 0x80 ? String.fromCharCode(bytes[i]) : CP437[bytes[i] - 0x80] |
| 835 | } |
| 836 | return name |
| 837 | } |
| 838 | } |
| 839 | |
| 840 | // CRC-32 (IEEE) lookup tables for sixteen bytes at a time |
| 841 | const CRC_TABLE = (() => { |