Function pack_note_to_string

Source
pub fn pack_note_to_string(note: &Note) -> Result<String, Error>
Expand description

Encodes a Note directly to a notepack_... Base64 string.

This is a convenience wrapper around pack_note, taking the binary payload and Base64-encoding it (without padding) and prefixing with notepack_.

This is the primary API for exporting notes for storage, transmission, or embedding in JSON.

§Errors

Returns the same Errors as pack_note, e.g. hex decoding issues.

§Example

use notepack::{Note, pack_note_to_string};

let note = Note { /* ... */ };
let s = pack_note_to_string(&note).unwrap();
assert!(s.starts_with("notepack_"));