binary

package
v0.94.0-pre Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package binary provides binary serialization routines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Atoi added in v0.92.0

func Atoi(s string, base int) int

Atoi converts string to a number in a given base. Base should be either 10 or 16. It uses `System.Binary.Atoi` syscall.

func Base58Decode added in v0.92.0

func Base58Decode(b []byte) []byte

Base58Decode decodes given base58 string represented as a byte slice into a new byte slice. It uses `System.Binary.Base58Decode` syscall.

func Base58Encode added in v0.92.0

func Base58Encode(b []byte) string

Base58Encode encodes given byte slice into a base58 string and returns byte representation of this string. It uses `System.Binary.Base58Encode` syscall.

func Base64Decode added in v0.91.0

func Base64Decode(b []byte) []byte

Base64Decode decodes given base64 string represented as a byte slice into byte slice. It uses `System.Binary.Base64Decode` interop.

func Base64Encode added in v0.91.0

func Base64Encode(b []byte) string

Base64Encode encodes given byte slice into a base64 string and returns byte representation of this string. It uses `System.Binary.Base64Encode` interop.

func Deserialize

func Deserialize(b []byte) interface{}

Deserialize unpacks previously serialized value from a byte slice, it's the opposite of Serialize. It uses `System.Binary.Deserialize` syscall.

func Itoa added in v0.92.0

func Itoa(num int, base int) string

Itoa converts num in a given base to string. Base should be either 10 or 16. It uses `System.Binary.Itoa` syscall.

func Serialize

func Serialize(item interface{}) []byte

Serialize serializes any given item into a byte slice. It works for all regular VM types (not ones from interop package) and allows to save them in storage or pass into Notify and then Deserialize them on the next run or in the external event receiver. It uses `System.Binary.Serialize` syscall.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL