str2bytes

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package str2bytes provides fast, but unsafe functions to convert string to []byte or vice versa.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(b []byte) string

BytesToString converts slice of bytes to string without allocation. See unsafe.String

func StringToBytes

func StringToBytes(s string) []byte

StringToBytes converts string to slice of bytes without allocation. Note, that returned slice must NOT be modified, since strings in Go are immutable. See unsafe.Slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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