randtoken

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package randtoken generates cryptographically random, hex-encoded tokens.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(n int) (string, error)

Generate returns a hex-encoded random token built from n random bytes.

func Hash

func Hash(raw string) string

Hash returns a hex-encoded SHA-256 digest of raw, for storing tokens generated by Generate without keeping the raw secret at rest.

Types

This section is empty.

Jump to

Keyboard shortcuts

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