Simple Serialize (SSZ)

Build Status

This package implements simple serialize algorithm specified in official Ethereum 2.0 spec.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      ssz:
        github: light-side-software/ssz.cr
  2. Run shards install

Usage

require "ssz"

class Person
  include SSZ::Serializable

  property name : String = ""
  property age : UInt16 = 0_u16

  def initialize(@name : String, @age : UInt16)
  end
end

person = Person.new("John", 32)
encoded = person.ssz_encode

decoded = Person.ssz_decode(encoded)

Supported types

Contributing

  1. Fork it (https://github.com/light-side-software/ssz.cr/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors