Satchel v0.1.1 Satchel View Source

Satchel is a library for serializing and de-serializing values. Currently, only little endian is supported (for my own convenience). The following types are supported:

  • bool (unsigned 8-bit int)
  • int8
  • uint8
  • int16
  • uint16
  • int32
  • uint32
  • int64
  • uint64
  • float32
  • float64
  • string
  • time, a tuple of secs and nsecs where both are uint32s.
  • duration, a tuple of secs and nsecs where both are int32s.

Link to this section Summary

Functions

Pack an Elixir value as a binary

Unpack a binary value

Unpack a binary which potentially contains other terms. Returns the value parsed and the rest of the binary

Link to this section Functions

Link to this function pack(data, type) View Source
pack(any(), atom()) :: binary()

Pack an Elixir value as a binary.

Link to this function unpack(data, type) View Source
unpack(binary(), atom()) :: any()

Unpack a binary value.

Link to this function unpack_take(binary, type) View Source
unpack_take(binary(), atom()) :: {any(), binary()}

Unpack a binary which potentially contains other terms. Returns the value parsed and the rest of the binary.

This does not accept variable-sized types like string.