convert

package
v0.0.0-...-56735eb Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 1 Imported by: 14

Documentation

Overview

Package convert provides functions for type conversion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesBEToUint16

func BytesBEToUint16(data []byte) uint16

BytesBEToUint16 converts data in big-endian format to a uint16.

func BytesBEToUint32

func BytesBEToUint32(data []byte) uint32

BytesBEToUint32 converts data in big-endian format to a uint32.

func BytesBEToUint64

func BytesBEToUint64(data []byte) uint64

BytesBEToUint64 converts data in big-endian format to a uint64.

func BytesLEToUint16

func BytesLEToUint16(data []byte) uint16

BytesLEToUint16 converts data in little-endian format to a uint16.

func BytesLEToUint32

func BytesLEToUint32(data []byte) uint32

BytesLEToUint32 converts data in little-endian format to a uint32.

func BytesLEToUint64

func BytesLEToUint64(data []byte) uint64

BytesLEToUint64 converts data in little-endian format to a uint64.

func BytesToUint8

func BytesToUint8(data []byte) uint8

BytesToUint8 converts data to a uint8.

func ToBool

func ToBool(v any) bool

ToBool converts it's argument to a Boolean.

func ToBytes

func ToBytes(v any) []byte

ToBytes converts it's argument to a Buffer VM type.

func ToInteger

func ToInteger(v any) int

ToInteger converts it's argument to an Integer.

func ToString

func ToString(v any) string

ToString converts it's argument to a ByteString VM type.

func Uint8ToBytes

func Uint8ToBytes(n uint8) []byte

Uint8ToBytes converts a uint8 to a fixed-length slice.

func Uint16ToBytesBE

func Uint16ToBytesBE(n uint16) []byte

Uint16ToBytesBE converts a uint16 to a fixed-length slice.

func Uint16ToBytesLE

func Uint16ToBytesLE(n uint16) []byte

Uint16ToBytesLE converts a uint16 to a fixed-length slice in little-endian format.

func Uint32ToBytesBE

func Uint32ToBytesBE(n uint32) []byte

Uint32ToBytesBE converts a uint32 to a fixed-length slice in big-endian format.

func Uint32ToBytesLE

func Uint32ToBytesLE(n uint32) []byte

Uint32ToBytesLE converts a uint32 to a fixed-length slice in little-endian format.

func Uint64ToBytesBE

func Uint64ToBytesBE(n uint64) []byte

Uint64ToBytesBE converts a uint64 to a fixed-length slice in big-endian format.

func Uint64ToBytesLE

func Uint64ToBytesLE(n uint64) []byte

Uint64ToBytesLE converts a uint64 to a fixed-length slice in little-endian format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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