conversion

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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