Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/snosme/ooz-wasm
https://github.com/snosme/ooz-wasm
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/snosme/ooz-wasm
- Owner: SnosMe
- License: gpl-3.0
- Created: 2020-09-25T10:09:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-14T13:15:02.000Z (about 1 year ago)
- Last Synced: 2024-11-17T18:07:38.311Z (about 2 months ago)
- Language: C++
- Homepage:
- Size: 51.8 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## ooz-wasm
[![](https://img.shields.io/npm/v/ooz-wasm/latest?color=CC3534&label=ooz-wasm&logo=npm&labelColor=212121)](https://www.npmjs.com/package/ooz-wasm)
WASM bindings for [ooz](https://github.com/powzix/ooz): Open source Kraken, Mermaid, Selkie, Leviathan, LZNA, Bitknit decompressor.
### Notes
- `.wasm` file is base64 embedded using `-s SINGLE_FILE=1`.
- WebAssembly Module is compiled when the ESM module is imported using a top-level `await`.Requires browser WebAssembly SIMD support.
- Can be enabled in Chromium-based browsers on `about://flags/#enable-webassembly-simd`
- Can be enabled in Firefox on `about:config` `javascript.options.wasm_simd`### Usage
```ts
// Decompress data
// NOTE: returned TypedArray lives in WASM memory, you can safely use it until the next call to decompressUnsafe/decompress.
function decompressUnsafe(data: Uint8Array, rawSize: number): Uint8Array;// Decompress data
function decompress(data: Uint8Array, rawSize: number): Uint8Array;
```### Build
1. Install Emscripten SDK
2. `emcmake cmake -B build [-G "..."]`
3. Build
```bash
# Ninja (-G "Ninja")
cmake --build build
# or Makefiles (-G "Unix Makefiles")
emmake make -C build
```