conversion

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromBytes added in v0.0.16

func FromBytes(bytes []byte) string

FromBytes 通过go 1.22新函数直接通过字节数组转换成字符串 不进行内存分配高性能 存在不安全性,共享底层数据

func FromFloat32 added in v0.0.13

func FromFloat32(value float32) string

FromFloat32 Float32转字符串

func FromFloat64 added in v0.0.13

func FromFloat64(value float64) string

FromFloat64 Float64转字符串

func FromInt added in v0.0.13

func FromInt(value int) string

FromInt Int转字符串

func FromInt16 added in v0.0.13

func FromInt16(value int16) string

FromInt16 Int16转字符串

func FromInt32 added in v0.0.13

func FromInt32(value int32) string

FromInt32 Int32转字符串

func FromInt64 added in v0.0.13

func FromInt64(value int64) string

FromInt64 Int64转字符串

func FromInt8 added in v0.0.13

func FromInt8(value int8) string

FromInt8 Int8转字符串

func FromUint added in v0.0.13

func FromUint(value uint) string

FromUint Uint转字符串

func FromUint16 added in v0.0.13

func FromUint16(value uint16) string

FromUint16 Uint16转字符串

func FromUint32 added in v0.0.13

func FromUint32(value uint32) string

FromUint32 Uint32转字符串

func FromUint64 added in v0.0.13

func FromUint64(value uint64) string

FromUint64 Uint64转字符串

func FromUint8 added in v0.0.13

func FromUint8(value uint8) string

FromUint8 Uint8转字符串

func ParesBytesFromHex added in v0.0.20

func ParesBytesFromHex(s string) []byte

ParesBytesFromHex 将hex编码的字符串转换成字节数组

func ParseBytes added in v0.0.16

func ParseBytes(s string) []byte

ParseBytes 通过go 1.22新函数 将字符串转换为字节数组 不进行内存分配高性能 存在不安全性,共享底层数据

func ParseFloat32 added in v0.0.16

func ParseFloat32(value string) float32

ParseFloat32 将字符串转换为float32

func ParseFloat64 added in v0.0.16

func ParseFloat64(value string) float64

ParseFloat64 将字符串转换为float64

func ParseInt added in v0.0.16

func ParseInt(value string) int

ParseInt 将字符串转换为int

func ParseInt16 added in v0.0.16

func ParseInt16(value string) int16

ParseInt16 将字符串转换为int16

func ParseInt32 added in v0.0.16

func ParseInt32(value string) int32

ParseInt32 将字符串转换为int32

func ParseInt64 added in v0.0.16

func ParseInt64(value string) int64

ParseInt64 将字符串转换为int64

func ParseInt8 added in v0.0.16

func ParseInt8(value string) int8

ParseInt8 将字符串转换为int8

func ParseUint added in v0.0.16

func ParseUint(value string) uint

ParseUint 将字符串转换为uint

func ParseUint16 added in v0.0.16

func ParseUint16(value string) uint16

ParseUint16 将字符串转换为uint16

func ParseUint32 added in v0.0.16

func ParseUint32(value string) uint32

ParseUint32 将字符串转换为uint32

func ParseUint64 added in v0.0.16

func ParseUint64(value string) uint64

ParseUint64 将字符串转换为uint64

func ParseUint8 added in v0.0.16

func ParseUint8(value string) uint8

ParseUint8 将字符串转换为uint8

Types

type Binaries

type Binaries []*Binary

Binaries 定义二进制数组

func NewFormBytes

func NewFormBytes(bytes []byte) *Binaries

NewFormBytes 通过bytes转换

func (*Binaries) RawType

func (b *Binaries) RawType() []*Binary

RawType 获取原始[]*Binary类型

func (*Binaries) To2Hex

func (b *Binaries) To2Hex(char ...string) string

To2Hex 每位转换2位hex字符串

func (*Binaries) To8Bits

func (b *Binaries) To8Bits(char ...string) (string, error)

To8Bits 每位转换8长度二进制字符串

type Binary

type Binary struct {
	// contains filtered or unexported fields
}

Binary 定义二进制值

func NewFromByte

func NewFromByte(decimal byte) *Binary

NewFromByte 通过byte转换

func NewFromDecimal

func NewFromDecimal(decimal int64) *Binary

NewFromDecimal 通过指定十进制数据转换

func NewFromRawBinary

func NewFromRawBinary(rawBinary string) (*Binary, error)

NewFromRawBinary 通过原始二进制值转换 010010110101

func NewFromRawHex

func NewFromRawHex(rawHex string) (*Binary, error)

NewFromRawHex 通过指定的原始hex值转换 ff

func (*Binary) To2Hex

func (b *Binary) To2Hex() (string, error)

To2Hex 将该二进制值转化为hex 2位

func (*Binary) To8Bit

func (b *Binary) To8Bit() (string, error)

To8Bit 将该二进制值转换为计算机bit 8位

func (*Binary) ToHexValue

func (b *Binary) ToHexValue() string

ToHexValue 转换位原始hex值

func (*Binary) Value

func (b *Binary) Value() string

Value 输出二进制值

Jump to

Keyboard shortcuts

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