Lob v1.0.1 Lob View Source
Length-Object-Binary (LOB) Packet Encoding
Data serialization, primarily in use by the Telehash Project
Link to this section Summary
Functions
Cloak a packet to frustrate wire monitoring
De-cloak a cloaked packet
Decode a wire packet for consumption
Encode a head and body into a packet
Link to this section Types
Link to this section Functions
Cloak a packet to frustrate wire monitoring
A random number (between 1 and 20) of rounds are applied. This also serves to slightly obfuscate the message size.
decloak(binary()) :: Lob.DecodedPacket.t() | no_return()
De-cloak a cloaked packet.
Upon success, the decoded packet will have the number of cloaking rounds unfurled
in the cloaked
field.
decode(binary()) :: Lob.DecodedPacket.t() | no_return()
Decode a wire packet for consumption
The parts are returned in a struct compliant with the specification.
Errors reflecting improperly decoded JSON are stored in the json
field.
encode(maybe_binary() | map(), maybe_binary()) :: binary() | no_return()
Encode a head and body into a packet
The packet should be usable across any supported transport. May raise an exception if the payload is too large or there are encoding errors.