OpenAgentID documentation
Source referencesRust module referenceopenagent-crypto-wasm

openagent-crypto-wasm · encoding

Declared module signatures, types, configuration, and source documentation.

Source: openagent-sdk/crates/openagent-crypto-wasm/src/encoding.rs. SHA-256: 9f8b44e6dae5524119b6fdf05def6dc7db8eb9b7165257052594db7899c03449.

This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.

encoding::encode

Encodes raw bytes as multibase base58btc with the z prefix.

Examples

let s = openagent_crypto_wasm::encoding::encode(&[0xDE, 0xAD, 0xBE, 0xEF]);
assert!(s.starts_with('z'));
pub fn encode(bytes: &[u8]) -> String;

Source line: 19.

encoding::decode

Decodes a multibase base58btc string (must start with z) into raw bytes.

Errors

[CryptoError::MultibaseFailed] if:

  • The input is empty or does not start with 'z'
  • The base58btc payload is malformed
pub fn decode(input: &str) -> Result<Vec<u8>, CryptoError>;

Source line: 33.

On this page