Skip to content

Commit

Permalink
version 0.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jueseitz committed Aug 2, 2024
1 parent 83726ab commit 067366b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["crates/*"]

[workspace.package]
edition = "2021"
version = "0.4.1"
version = "0.4.2"
description = """
The Rust Architecture for XML Binding
"""
Expand All @@ -16,13 +16,13 @@ categories = []
keywords = []

[workspace.dependencies]
raxb = { version = "0.4.1", path = "crates/raxb" }
raxb-libxml2-sys = { version = "0.4.1", path = "crates/raxb-libxml2-sys" }
raxb-derive = { version = "0.4.1", path = "crates/raxb-derive" }
raxb-validate = { version = "0.4.1", path = "crates/raxb-validate" }
raxb-xmlschema = { version = "0.4.1", path = "crates/raxb-xmlschema" }
raxb-xmlschema-build = { version = "0.4.1", path = "crates/raxb-xmlschema-build" }
raxb-axum = { version = "0.4.1", path = "crates/raxb-axum" }
raxb = { version = "0.4.2", path = "crates/raxb" }
raxb-libxml2-sys = { version = "0.4.2", path = "crates/raxb-libxml2-sys" }
raxb-derive = { version = "0.4.2", path = "crates/raxb-derive" }
raxb-validate = { version = "0.4.2", path = "crates/raxb-validate" }
raxb-xmlschema = { version = "0.4.2", path = "crates/raxb-xmlschema" }
raxb-xmlschema-build = { version = "0.4.2", path = "crates/raxb-xmlschema-build" }
raxb-axum = { version = "0.4.2", path = "crates/raxb-axum" }

anyhow = "1"
async-trait = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/raxb-validate-wasm/package.tmp.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
],
"type": "module",
"url": "https://github.com/hd-gmbh-dev/raxb",
"version": "0.4.1",
"version": "0.4.2",
"files": [
"raxb-validate-wasm.wasm",
"raxb-validate-wasm.js",
Expand Down
11 changes: 10 additions & 1 deletion packages/raxb-validate-wasm/src/lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ class U8Reader {
return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24);
}

uint32_t readU32_LE() {
auto b1 = this->readU8();
auto b2 = this->readU8();
auto b3 = this->readU8();
auto b4 = this->readU8();
return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24);
}

uint64_t readU64() {
uint64_t b2 = this->readU32();
uint32_t b1 = this->readU32();
Expand Down Expand Up @@ -315,11 +323,12 @@ class XmlValidator {
auto memoryView = uint8ArrayObject["constructor"].new_(memory, reinterpret_cast<uintptr_t>(buffer.data()), length);
memoryView.call<void>("set", uint8ArrayObject);
U8Reader rdr((uint8_t*)buffer.data(), length);
int decompressed_len = (int) rdr.readU32();
int decompressed_len = (int) rdr.readU32_LE();
char* regen_buffer = (char*)malloc(decompressed_len);
this->_buffer_len = LZ4_decompress_safe((char*)buffer.data() + 4, regen_buffer, (int)length - 4, decompressed_len);
this->_buffer = regen_buffer;
}

~XmlValidator() {
this->_schema_bundle->destroy();
}
Expand Down

0 comments on commit 067366b

Please sign in to comment.