utils

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

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

Go to latest
Published: Dec 28, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package utils is define utils function

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func B2S

func B2S(b []byte) string

B2S use no copy convert byte slice to string

func Bytes2Int16

func Bytes2Int16(b []byte, order binary.ByteOrder) (value int16)

Bytes2Int16 is convert byte slice to int16

func Bytes2Timestamp

func Bytes2Timestamp(b []byte) int64

Bytes2Timestamp is convert bytes to second timestamp

func DecodeGB18030

func DecodeGB18030(b []byte) []byte

DecodeGB18030 is decode GB18030

func EncodeGB18030

func EncodeGB18030(b []byte) []byte

EncodeGB18030 is encode GB18030

func S2B

func S2B(s string) []byte

S2B use no copy convert string to byte slice

func Timestamp2Bytes

func Timestamp2Bytes(timestamp int64) []byte

Timestamp2Bytes is convert second timestamp to bytes

Types

type SumResult

type SumResult uint32

SumResult is sum result

func Sum

func Sum(b []byte) SumResult

Sum is get byte slice sum

func (SumResult) Bytes16

func (s SumResult) Bytes16(order binary.ByteOrder) []byte

Bytes16 is get sum result convert to uint16 byte slice

func (SumResult) Equal

func (s SumResult) Equal(want []byte, order binary.ByteOrder) bool

Equal is compare byte slice sum

Jump to

Keyboard shortcuts

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