hexutil

package
v0.0.0-...-3e4d930 Latest Latest
Warning

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

Go to latest
Published: May 4, 2019 License: LGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyString empty hex string
	ErrEmptyString = &decError{"empty hex string"}
	// ErrSyntax invalid hex string
	ErrSyntax = &decError{"invalid hex string"}
	// ErrMissingPrefix hex string without 0x prefix
	ErrMissingPrefix = &decError{"hex string without 0x prefix"}
	// ErrInvalidOddLength hex string of odd length
	ErrInvalidOddLength = &decError{"hex string of odd length"}
)

Functions

func BytesToHex

func BytesToHex(b []byte) string

BytesToHex encodes b as a hex string with 0x prefix.

func Has0xPrefix

func Has0xPrefix(input string) bool

Has0xPrefix returns true if input start with 0x, otherwise false

func HexToBytes

func HexToBytes(input string) ([]byte, error)

HexToBytes decodes a hex string with 0x prefix.

func MustHexToBytes

func MustHexToBytes(input string) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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