MCPcopy Create free account
hub / github.com/Effect-TS/effect / decodeName

Function decodeName

packages/effect/src/encoding/Zip.ts:827–838  ·  view source on GitHub ↗
(bytes: Uint8Array, utf8: boolean)

Source from the content-addressed store, hash-verified

825 "≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
826
827const 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
841const CRC_TABLE = (() => {

Callers 1

parseLocalMethod · 0.70

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected