diff --git a/README.md b/README.md index 8d70a17..f995811 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,28 @@ gustav [![Build Status](https://travis-ci.org/Raphexion/gustav.svg?branch=master)](https://travis-ci.org/Raphexion/gustav) -A helper library. +A helper library for two use-cases: + +. To help pack-up and un-pack data +. To help with writing a udp-server Examples -------- -Packing up a dictionary into a binary payload: +Imagine that you have a state `#{a => 1, b => 2, c => 3, d => 4}`. +You need to pack-up this data (serialize) and send it over the wire. +Your protocol specifies that: + +| Variable | Bits in payload | +|----------|-----------------| +| a | 8 | +| b | 16 | +| c | 32 | +| d | 8 | + +Which can be described compactly as `[{a, 8}, {b, 16}, {c, 32}, {d, 8}]`. + +When using *Gustav*, packing up the dictionary into a binary payload: ``` Dictionary = #{a => 1, b => 2, c => 3, d => 4},