convert

package
v0.0.0-...-8992419 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: Apache-2.0 Imports: 4 Imported by: 14

Documentation

Overview

Package convert provides helper functions to convert data between various types, e.g. []byte to int, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPByteSlice

func IPByteSlice(ip string) []byte

IPByteSlice converts a string that contains an IP address into byte slice

func Int64Byte

func Int64Byte(data int64) (ret []byte)

Int64Byte converts a int64 to a byte slice in BigEndian

func Reverse

func Reverse(data []byte) []byte

Reverse reverses byte slice without allocating new memory

func Uint16

func Uint16(data []byte) (ret uint16)

Uint16 converts a byte slice into uint16 assuming LittleEndian

func Uint16Byte

func Uint16Byte(data uint16) (ret []byte)

Uint16Byte converts a uint16 to a byte slice in BigEndian

func Uint16b

func Uint16b(data []byte) (ret uint16)

Uint16b converts a byte slice to uint16 assuming the slice is BigEndian

func Uint32

func Uint32(data []byte) (ret uint32)

Uint32 converts a byte slice into uint32 assuming LittleEndian

func Uint32Byte

func Uint32Byte(data uint32) (ret []byte)

Uint32Byte converts a uint16 to a byte slice in BigEndian

func Uint32b

func Uint32b(data []byte) (ret uint32)

Uint32b converts a byte slice to uint32 assuming the slice is BigEndian

func Uint64

func Uint64(data []byte) uint64

Uint64 converts a byte slice into uint64 assuming LittleEndian

func Uint64Byte

func Uint64Byte(data uint64) (ret []byte)

Uint64Byte converts a uint64 to a byte slice in BigEndian

func Uint64b

func Uint64b(data []byte) (ret uint64)

Uint64b converts a byte slice to uint64 assuming the slice is BigEndian

func Uint8Byte

func Uint8Byte(data uint8) (ret []byte)

Uint8Byte converts a uint8 to a byte slice in BigEndian

func UintX

func UintX(data []byte) (ret uint64)

UintX converts a byte slice into uint64 assuming LittleEndian

Types

This section is empty.

Jump to

Keyboard shortcuts

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