Copyright © (C) 2018-2020, Jan Henry Nystrom <JanHenryNystrom@gmail.com> -------------------------------------------------------------------
Authors: Jan Henry Nystrom (JanHenryNystrom@gmail.com).
A Bencoding library based on: The BitTorrent specification
Bencoding is represented as follows:
Byte string : binary (octets) Integer : integer List : list Dictionary : mapbencoding() = binary() | integer() | list() | map()
opt() = binary | iolist | continue
decode/1 | Decodes the iodata into a structured Erlang term. |
decode/2 | Decodes the iodata into a structured Erlang term. |
encode/1 | Encodes the structured Erlang term as an iolist. |
encode/2 | Encodes the structured Erlang term as an iolist or binary. |
decode(Binary::binary()) -> bencoding()
Decodes the iodata into a structured Erlang term. Equivalent of decode(JSON, []) -> Term.
decode(Binary::binary(), Opts::[opt()]) -> bencoding() | {bencoding(), binary()}
Decodes the iodata into a structured Erlang term. Options are: continue -> return the tuple of the decoded Bencoding and the remaining binary
encode(Term::bencoding()) -> iolist()
Encodes the structured Erlang term as an iolist. Equivalent of encode(Term, []) -> Bencoding.
encode(Term::bencoding(), Opts::[opt()]) -> iolist() | binary()
Encodes the structured Erlang term as an iolist or binary. Encode will give an exception if the erlang term is not well formed. Options are: binary -> a binary is returned iolist -> an iolist is returned (default)
Generated by EDoc