use-wasm-binary 0.0.1

WebAssembly binary magic-byte, version-byte, marker, and header validation primitives.
Documentation
  • Coverage
  • 100%
    23 out of 23 items documented1 out of 16 items with examples
  • Size
  • Source code size: 9.56 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 563.39 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-wasm
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-wasm-binary

WebAssembly binary format primitives for RustUse. This crate checks magic bytes and version bytes without parsing full Wasm binaries.

Example

use use_wasm_binary::{looks_like_wasm_binary, validate_wasm_header};

let bytes = b"\0asm\x01\0\0\0";
let header = validate_wasm_header(bytes).expect("valid header");

assert!(looks_like_wasm_binary(bytes));
assert_eq!(header.version(), 1);

Scope

  • Magic bytes, version bytes, and minimal header validation.
  • Helpers for byte slices that look like Wasm binaries.

Non-goals

  • No full binary decoding.
  • No validation beyond the header.

License

Licensed under either of the following, at your option:

  • Apache License, Version 2.0
  • MIT license