@mixen/core
v0.1.2
Published
Browser-safe ESM library for Westwood `.mix` archives.
Downloads
326
Readme
@mixen/core
Browser-safe ESM library for Westwood .mix archives.
Includes:
- MIX parsing (
parseMix) - Range-backed parsing (
parseMixFromReader) - In-memory extract/pack (
extractMix,packMix,packMixWithEmbeddedIndex) - Range-backed archive adapter (
MixArchiveReader) - Binary embedded index entry (
__mixen_index.bin) - Binary sidecar index format (
sidecarIndexToBytes/sidecarIndexFromBytes) - Recursive tree walking for nested mixes (
walkMixIndexTree) - Range-backed index + integrity builders (
buildMixIndexFromReader,buildIntegrityFromReader) - Range-backed embedded index loader (
loadEmbeddedMixIndexFromReader)
Note: encrypted RA2 MIX header parsing is available via the optional crypto add-on. Import @mixen/core/crypto once before parsing encrypted mixes.
Note: MixArchiveReader.containsFile/containsHash are synchronous only when you provide an index; otherwise call await archive.ready() first.
Bounds validation
parseMix validates that entry ranges stay within the declared data section and file bounds by default. For maximum speed with trusted inputs you can disable this:
parseMix(bytes, { validateBounds: false })parseMixFromReader({ read, size, validateBounds: false })
