Expand description
This crate implements the ssb legacy data format, i.e. the free-form data that forms the content of legacy messages.
Two encodings are implemented: the signing encoding, and the json transport encoding.
Modules§
- json
- This module implements the json encodings of the legacy ssb data format, both signing and json transport.
- value
- Data structures for storing and manipulating arbitrary legacy data.
Structs§
- Legacy
F64 - A wrapper around
f64
to indicate that the float is compatible with the ssb legacy message data model, i.e. it is neither an infinity, nor-0.0
, nor aNaN
. - Weird
Encoding Iterator - An iterator that yields the bytes needed to compute a hash of some legacy data.
Functions§
- is_
i64_ valid - Checks whether a given
i64
is allowed for usage in ssb data (its absolute value is not larger than 2^53). - is_
u64_ valid - Checks whether a given
u64
is allowed for usage in ssb data (it is not larger than 2^53). - legacy_
length - Compute the length
of some data. Note that this takes time linear in the length of the data,
so you might want to use a
WeirdEncodingIterator
for computing hash and length in one go. - to_
weird_ encoding - Create an owned representation of the weird encoding used for hash computation of legacy ssb messages. The number of bytes yielded by this iterator coincides with the length of the data.