hack

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 2 Imported by: 14

Documentation

Overview

Package hack gives you some efficient functionality at the cost of breaking some Go rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RuntimeMemhash added in v0.10.0

func RuntimeMemhash(b []byte, seed uint64) uint64

RuntimeMemhash provides access to the Go runtime's default hash function for arbitrary bytes. This is an optimal hash function which takes an input seed and is potentially implemented in hardware for most architectures. This is the same hash function that the language's `map` uses.

func RuntimeStrhash added in v0.10.0

func RuntimeStrhash(str string, seed uint64) uint64

RuntimeStrhash provides access to the Go runtime's default hash function for strings. This is an optimal hash function which takes an input seed and is potentially implemented in hardware for most architectures. This is the same hash function that the language's `map` uses.

func String

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

String force casts a []byte to a string. USE AT YOUR OWN RISK

func StringPointer

func StringPointer(s string) unsafe.Pointer

StringPointer returns &s[0], which is not allowed in go

Types

This section is empty.

Jump to

Keyboard shortcuts

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