Categorygithub.com/TimeleapLabs/go-sia/v2
package
2.4.0
Repository: https://github.com/timeleaplabs/go-sia.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Sia

Build Status

Sia - Binary serialisation and deserialisation with built-in compression. You can consider Sia a strongly typed, statically typed domain specific binary language for constructing data. Sia preserves data types and supports custom ones.

Install

go get github.com/pouya-eghbali/go-sia

Basic Usage

To serialize multiple values, first create a sia object and then you can add values in order. Note that the order of adding values should be considered when you want to read them again.

Serializing:

rawByte := sia.New().
    AddUInt16(1234).
    AddString64("think simple, do simple!").
    Bytes()

Deserializing:

deserialized := sia.NewFromBytes(rawByte)
gotSampleUint16 := deserialized.ReadUInt16() // 1234
gotSampleString := deserialized.ReadString64() // think simple, do simple!

Note that sia can't handle serializing of arrays, so it will fall back to JSON marshal about them.