zarith

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(source []byte) (*big.Int, error)

Decode decodes a zarith encoded unsigned integer from the entire input byte array. Assumes the input contains no extra trailing bytes.

func DecodeHex

func DecodeHex(source string) (*big.Int, error)

DecodeHex decodes a zarith encoded unsigned integer from the entire input hex string. Assumes the input contains no extra trailing bytes.

func DecodeSigned added in v2.1.0

func DecodeSigned(source []byte) (*big.Int, error)

DecodeSigned decodes a zarith encoded signed integer from the entire input byte array. Assumes the input contains no extra trailing bytes.

func DecodeSignedHex added in v2.1.0

func DecodeSignedHex(source string) (*big.Int, error)

DecodeSignedHex decodes a zarith encoded signed integer from the entire input hex string. Assumes the input contains no extra trailing bytes.

func Encode

func Encode(value *big.Int) ([]byte, error)

Encode encodes an unsigned integer to zarith

func EncodeSigned added in v2.1.0

func EncodeSigned(value *big.Int) []byte

EncodeSigned encodes a signed integer to zarith

func EncodeSignedToHex added in v2.1.0

func EncodeSignedToHex(value *big.Int) string

EncodeSignedToHex encodes a signed integer to zarith

func EncodeToHex

func EncodeToHex(value *big.Int) (string, error)

EncodeToHex encodes an unsigned integer to zarith

func ReadNext

func ReadNext(byteStream []byte) (*big.Int, int, error)

ReadNext reads the next variable-length zarith-encoded unsigned integer from the given byte stream. Returns the zarith number and the count of bytes read. Extra bytes are ignored.

func ReadNextSigned added in v2.1.0

func ReadNextSigned(byteStream []byte) (*big.Int, int, error)

ReadNextSigned reads the next variable-length zarith-encoded signed integer from the given byte stream. Returns the zarith number and the count of bytes read. Extra bytes are ignored.

Types

This section is empty.

Jump to

Keyboard shortcuts

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