Skip to main content

Module bytes

Module bytes 

Source
Expand description

Hex parsing / display helpers shared by every typed-byte newtype. Mirrors bee-go’s pkg/swarm/bytes.go Bytes base type, but in Rust we don’t need a runtime base struct — instead we expose free helpers that the define_typed_bytes! macro (in swarm::typed_bytes) uses to build each newtype’s from_hex, to_hex, and serde impls.

Functions§

decode_hex
Decode a hex string (with or without 0x prefix).
encode_hex
Encode bytes as lowercase hex (no 0x prefix), matching bee-js / bee-go wire format.