Skip to content

About

Pure JavaScript Mermaid decompressor (clean-room implementation, MIT). No dependencies, no WebAssembly.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

mermaid-decompress

Decompress data in the Mermaid compressed format in pure JavaScript, in the browser or Node 18+. No dependencies, no WebAssembly, about 7 KB gzipped, MIT licensed.

Mermaid streams appear in some Unreal Engine games, for example in Palworld save files. For reading Palworld saves end to end, see palworld-save-decoder, which uses this decoder. It powers the save reader in the Sourcemined Palworld IV calculator.

import { decompress } from 'mermaid-decompress';

const out = decompress(compressedBytes, uncompressedSize); // Uint8Array
  • decompress(src: Uint8Array, size: number): Uint8Array decodes a raw Mermaid stream to exactly size bytes.
  • Errors throw MermaidError (code: "corrupt"); valid streams that use features this decoder does not implement (other codecs, tANS entropy, composite arrays, checksums) throw UnsupportedError (code: "unsupported").
  • Every write is bounds-checked; damaged input ends in a clean error, never a hang or out-of-bounds write (fuzz-tested).

Speed: about 300 MB/s of output on Node 22 for real save files.

Scope

The decoder covers the Mermaid features produced at the default compression level. Streams compressed at high levels may use tANS entropy coding, which is not implemented yet and is reported as unsupported.

How it was written

This is an independent implementation written from a format specification, without access to any existing decoder's source code. See CLEANROOM.md.

Trademarks

Oodle is a trademark of its owner. This project is not affiliated with or endorsed by RAD Game Tools or Epic Games.

Licence

MIT, see LICENSE.

About

Pure JavaScript Mermaid decompressor (clean-room implementation, MIT). No dependencies, no WebAssembly.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages