Skip to content

TimeleapLabs/go-sia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Sia serialization for Go

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages