unsafestring

package
v0.0.0-...-91ac70b Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToBytes

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

ToBytes returns a byte slice aliasing to the contents of the input string. Many hash functions are written to take []byte as input -- this lets us provide an API that takes a string and use those hash functions without a temporary allocation (and the garbage and copying string contents an allocation implies).

SAFETY: the returned byte slice MUST NOT be written to, only read.

Types

This section is empty.

Jump to

Keyboard shortcuts

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