zarith

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 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

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

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

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

EncodeSigned encodes a signed integer to zarith

func EncodeSignedToHex

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

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