Skip to content

Commit

Permalink
feat: add lz4 decompress size prepended
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsuk1ko committed May 13, 2024
1 parent 5520c71 commit b516cea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unity-js-tools"
version = "1.1.0"
version = "1.2.0"
edition = "2021"
authors = ["神代綺凛 <[email protected]>"]
license = "MIT"
Expand All @@ -16,7 +16,7 @@ codegen-units = 1
crate-type = ["cdylib"]

[dependencies]
lz4_flex = "0.11.1"
paste = "1.0.14"
lz4_flex = "0.11.3"
paste = "1.0.15"
texture2ddecoder = "0.0.5"
wasm-bindgen = "0.2.87"
wasm-bindgen = "0.2.92"
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mod tools;

use lz4_flex::decompress;
use lz4_flex::block::decompress_size_prepended;
use texture2ddecoder::*;
use tools::*;
use wasm_bindgen::prelude::*;
Expand Down Expand Up @@ -56,3 +57,7 @@ pub fn export_decode_astc(
pub fn export_decompress_lz4(data: &[u8], size: usize) -> Result<Vec<u8>, JsError> {
decompress(data, size).map_err(to_js_err)
}
#[wasm_bindgen(js_name = decompressLz4SizePrepended)]
pub fn export_decompress_lz4_size_prepended(data: &[u8]) -> Result<Vec<u8>, JsError> {
decompress_size_prepended(data).map_err(to_js_err)
}

0 comments on commit b516cea

Please sign in to comment.