This page is a placeholder. All examples on this page are currently AI-generated and are not correct. This documentation will be completed in the future with accurate, tested examples.
WASM performance note: toHex() is a simple conversion that generally does not run faster under WASM. The JS↔WASM boundary adds overhead, while JavaScript’s built-ins already handle hex/string formatting efficiently. Prefer the default JS entrypoint for toHex() and similar conversions; use WASM for compute-heavy operations (Keccak256 hashing, ABI/RLP encoding/decoding, secp256k1/BLS) where performance gains are significant.Voltaire’s WASM builds intentionally optimize for both performance and bundle size. For maximum performance, build from source with the performance-optimized WASM target. See /dev/build-system#typescript-targets and /dev/wasm#build-modes.
Zero allocation - Creates new string but no intermediate buffers.Time complexity: O(n) where n = 20 bytes (constant time).String concatenation: Efficient for this fixed size (40 hex chars).For repeated conversions, consider caching the result: