Skip to main content

blob

Macro blob 

Source
blob!() { /* proc-macro */ }
Expand description

Converts a hex string to a compile-time [Blob<N>].

Two forms:

  • blob!("DEADBEEF") โ€” exact-fit Blob<4> where N equals the decoded byte count.
  • blob!("DEADBEEF", 128) โ€” Blob<128> zero-padded to the given capacity; the decoded byte count must not exceed the capacity.

In both forms len is set to the decoded byte count. The hex string must have an even number of characters.

ยงExample

โ“˜
use xrpl_wasm_stdlib::blob;
use xrpl_wasm_stdlib::core::types::blob::Blob;

const EXACT: Blob<4> = blob!("DEADBEEF");
const PADDED: Blob<32> = blob!("DEADBEEF", 32);