Binary Field Encodings (BFE) for Secure Scuttlebutt (SSB).
Go to file
2022-09-23 10:31:05 +01:00
lib add function comments and throw on unmatched decode attempts 2022-09-23 10:31:05 +01:00
test add tests for decoding 2022-09-22 15:28:53 +01:00
.formatter.exs add elixir project files 2022-05-05 19:50:19 +02:00
.gitignore add lockfile to ignore list 2022-09-20 19:34:41 +01:00
mix.exs update manifest 2022-09-19 16:39:48 +01:00
README.md update readme with decode example 2022-09-22 15:32:57 +01:00

SsbBfe

Binary Field Encodings (BFE) for Secure Scuttlebutt (SSB).

See the SSB Binary Field Encodings Specification for details.

Encoding

SsbBfe.encode(value)

Decoding

SsbBfe.decode(value)

Supported Types

Elixir Types

Encoding of the following Elixir types is supported:

  • List
  • Map
  • Tuple
  • String
  • Boolean
  • Nil
  • Integer
  • Float

Note: encoding of structs is not supported. You may wish to convert your struct to amap and encode it that way.

Scuttlebutt Types

Encoding of the following Scuttlebutt types is supported:

  • Feed (classic)
  • Message (classic)
  • Blob
  • Signature
  • Private message (box, box2)

Note: encoding of URIs is not currently supported, nor are other formats such as Gabby Grove and Bendy Butt.

Installation

If available in Hex, the package can be installed by adding ssb_bfe to your list of dependencies in mix.exs:

def deps do
  [
    {:ssb_bfe, "~> 0.1.0"}
  ]
end

Documentation

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ssb_bfe.

License

LGPL-3.0.