crypto

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPassphraseBytes is the number of random bytes for passphrase generation.
	// 32 bytes = 256 bits of entropy, encoded as ~43 base64 characters.
	DefaultPassphraseBytes = 32
)

Variables

This section is empty.

Functions

func GeneratePassphrase

func GeneratePassphrase(numBytes int) (string, error)

GeneratePassphrase creates a cryptographically secure passphrase. The passphrase is URL-safe base64 encoded (no padding) for easy handling.

func HashFile

func HashFile(path string) (string, error)

HashFile returns the SHA-256 hash of a file, prefixed with "sha256:". This function requires file system access and is not available in WASM.

Types

This section is empty.

Jump to

Keyboard shortcuts

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