module Fremkit::Utils::RLP

Overview

Helper functions for RLP

Defined in:

utils/rlp.cr

Class Method Summary

Instance Method Summary

Class Method Detail

def self.alloc_with_header : IO::Memory #

[View source]
def self.encode(items : Array) : Bytes #

General version: serialize all items one by one. This won't support payloads more than 64K in total.


[View source]
def self.encode(bytes : Bytes) : Bytes #

Specialize template for bytes


[View source]
def self.write_header(payload : Bytes, payload_size : UInt32) #

[View source]

Instance Method Detail

def decode(bytes : Bytes) : Tuple(Bytes, UInt32) #

Specialization for when this is a list of bytes


[View source]
def rlp_bytes_size(bytes : Bytes) : UInt32 #

[View source]