package exstrings
import "go.mau.fi/util/exstrings"
Index ¶
- func ConstantTimeEqual(a, b string) bool
- func SHA256(str string) [32]byte
- func UnsafeBytes(str string) []byte
Functions ¶
func ConstantTimeEqual ¶
ConstantTimeEqual compares two strings using subtle.ConstantTimeCompare without copying the strings.
Note that ConstantTimeCompare is not constant time if the strings are of different length.
func SHA256 ¶
SHA256 returns the SHA-256 hash of the input string without copying the string.
func UnsafeBytes ¶
UnsafeBytes returns a byte slice that points to the same memory as the input string.
The returned byte slice must not be modified.
Source Files ¶
stringutil.go
- Version
- v0.8.6 (latest)
- Published
- Mar 16, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 1 week ago –
Tools for package owners.