util

package
v0.0.0-...-5a484b5 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package util provides some useful methods that are used within the 'at' package. These methods include a method to extract bytes from a string.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnevenLength = errors.New("parse octets: uneven length of string")
	ErrUnexpected   = errors.New("parse octets: met a non-HEX rune in string")
)

Common errors.

Functions

func Bytes

func Bytes(hex string) ([]byte, error)

Bytes parses the hex-string of odd length into bytes.

func HexString

func HexString(octets []byte) string

HexString produces a hex-string from bytes. Like a DEADBEEF, without prepending the 0x.

func MustBytes

func MustBytes(hex string) []byte

MustBytes is an alias for Bytes, except that it will panic if there is any parse error.

func SplitStringBySize

func SplitStringBySize(str string, maxSize int) []string

SplitStringBySize Split string to parts by size (https://play.golang.org/p/uUKx0hsm_O)

Types

This section is empty.

Jump to

Keyboard shortcuts

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