fastbytes

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: MIT Imports: 2 Imported by: 2

README

fastbytes

Auxiliary library, which is faster than the standard bytes library and contains several new features. Based on unsafe!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func B2I added in v1.1.1

func B2I(b []byte) int

B2I converts a byte slice to an int.

func B2I16 added in v1.0.5

func B2I16(b []byte) int16

B2I16 converts a byte slice to an int16

func B2I32 added in v1.0.5

func B2I32(b []byte) int32

B2I32 converts a byte slice to an int32

func B2I64

func B2I64(b []byte) int64

B2I64 converts a byte slice to an int64

func B2I8 added in v1.0.5

func B2I8(b []byte) int8

B2I8 converts a byte slice to an int8

func B2S

func B2S(b []byte) string

B2S converts a byte slice to a string

func B2U added in v1.1.1

func B2U(b []byte) uint

B2U converts a byte slice to an uint

func B2U16 added in v1.0.5

func B2U16(b []byte) uint16

B2U16 converts a byte slice to an uint16

func B2U32 added in v1.0.5

func B2U32(b []byte) uint32

B2U32 converts a byte slice to an uint32

func B2U64 added in v1.0.5

func B2U64(b []byte) uint64

B2U64 converts a byte slice to an uint64

func B2U8 added in v1.0.5

func B2U8(b []byte) uint8

B2U8 converts a byte slice to an uint8

func BytesToLowerCase added in v1.0.5

func BytesToLowerCase(buf []byte)

BytesToLowerCase converts all bytes in buf to lowercase.

func BytesToUpperCase added in v1.0.5

func BytesToUpperCase(buf []byte)

BytesToUpperCase converts all bytes in buf to uppercase.

func BytesTrimLeft added in v1.0.5

func BytesTrimLeft(buf []byte) []byte

BytesTrimLeft trims all empty bytes (' ') from the left and returns a new slice.

func BytesTrimRight added in v1.2.0

func BytesTrimRight(buf []byte) []byte

BytesTrimRight trims all empty bytes (' ') from the right and returns a new slice.

func Equal

func Equal(a, b []byte) bool

Equal returns true if the two bytes slice are equal. If you are sure that two bytes slice have same length, use EqualValue instead.

func I16ToB added in v1.1.0

func I16ToB(i int16) []byte

I16ToB converts an int16 to a byte slice using unsafe

func I2B added in v1.1.0

func I2B(i int) []byte

I2B converts an int to a byte slice using unsafe. Return a byte slice of length 8!

func I32ToB added in v1.1.0

func I32ToB(i int32) []byte

I32ToB converts an int32 to a byte slice using unsafe

func I64ToB added in v1.1.0

func I64ToB(i int64) []byte

I64ToB converts an int64 to a byte slice using unsafe

func I8ToB added in v1.1.0

func I8ToB(i int8) []byte

I8ToB converts an int8 to a byte slice using unsafe

func PutI added in v1.2.0

func PutI(b []byte, i int)

PutI put an int to a byte slice using unsafe. The byte slice len must be 8 or the byte slice must be nil!

func PutI16 added in v1.2.0

func PutI16(b []byte, i int16)

PutI16 put an int16 to a byte slice using unsafe

func PutI32 added in v1.2.0

func PutI32(b []byte, i int32)

PutI32 put an int32 to a byte slice using unsafe

func PutI64 added in v1.2.0

func PutI64(b []byte, i int64)

PutI64 put an int64 to a byte slice using unsafe

func PutI8 added in v1.2.0

func PutI8(b []byte, i int8)

PutI8 put an int8 to a byte slice using unsafe

func PutU added in v1.2.0

func PutU(b []byte, u uint)

PutU put an uint to a byte slice using unsafe. The byte slice len must be 8!

func PutU16 added in v1.2.0

func PutU16(b []byte, u uint16)

PutU16 put an uint16 to a byte slice using unsafe

func PutU32 added in v1.2.0

func PutU32(b []byte, u uint32)

PutU32 put an uint32 to a byte slice using unsafe

func PutU64 added in v1.2.0

func PutU64(b []byte, u uint64)

PutU64 put an uint64 to a byte slice using unsafe

func PutU8 added in v1.2.0

func PutU8(b []byte, u uint8)

PutU8 put an uint8 to a byte slice using unsafe

func S2B

func S2B(s string) (b []byte)

S2B converts a string to a byte slice

func U16ToB added in v1.1.0

func U16ToB(u uint16) []byte

U16ToB converts an uint16 to a byte slice using unsafe

func U2B added in v1.1.0

func U2B(u uint) []byte

U2B converts an uint to a byte slice using unsafe. Return a byte slice of length 8!

func U32ToB added in v1.1.0

func U32ToB(u uint32) []byte

U32ToB converts an uint32 to a byte slice using unsafe

func U64ToB added in v1.1.0

func U64ToB(u uint64) []byte

U64ToB converts an uint64 to a byte slice using unsafe

func U8ToB added in v1.1.0

func U8ToB(u uint8) []byte

U8ToB converts an uint8 to a byte slice using unsafe

Types

This section is empty.

Jump to

Keyboard shortcuts

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