urbit-q

Crates.iourbit-q
lib.rsurbit-q
version0.3.2
sourcesrc
created_at2020-06-16 14:49:25.276905
updated_at2020-06-22 12:22:07.756378
descriptionEncode and decode data in Urbit's @q format
homepage
repositoryhttps://github.com/k2l8m11n2/urbit-q
max_upload_size
id254540
size25,236
Alicja (k2l8m11n2)

documentation

README

urbit-q

Based on urbit-ob, supports only the @q format.

usage

Note that when encoding more than one byte, encode pads from the beginning to an even number of bytes (as per the original implementation) and decode ignores any dashes, tildes or spaces within the string.

urbit_q::encode(&[1]); // nec
let string = urbit_q::encode(&[1, 2, 3]); // doznec-binwes
urbit_q::decode(&string).unwrap(); // [0, 1, 2, 3]
urbit_q::decode("doz nec bin wes"); // Some([0, 1, 2, 3])
urbit_q::decode("do-z ne cb~inwes"); // Some([0, 1, 2, 3])
urbit_q::decode("nec-binwes"); // Some([1, 2, 3])
urbit_q::decode("hello world"); // None
Commit count: 32

cargo fmt