ByteSlice abstracts a byte slice.
Decbuf provides safe methods to extract data from a byte slice. It does all necessary bounds checking and advancing of the byte slice. Several datums can be extracted without checking for errors. However, before using any datum, the err() method must be checked.
NewDecbufAt returns a new decoding buffer. It expects the first 4 bytes after offset to hold the big endian encoded content length, followed by the contents and the expected checksum.
NewDecbufUvarintAt returns a new decoding buffer. It expects the first bytes after offset to hold the uvarint-encoded buffers length, followed by the contents and the expected checksum.
Crc32 returns a CRC32 checksum over the remaining bytes.
Encbuf is a helper type to populate a byte slice with various types.
PutHash appends a hash over the buffers current contents to the buffer.
PutUvarintStr writes a string to the buffer prefixed by its varint length (in bytes!).