text

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LowerAlpha = "abcdefghijklmnopqrstuvwxyz"
	UpperAlpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	Alpha      = LowerAlpha + UpperAlpha
	Digits     = "0123456789"
	AlphaNum   = Alpha + Digits
	HexChars   = "0123456789abcdef"
)

Variables

This section is empty.

Functions

func Dedent

func Dedent(s string) string

Dedent strips the common leading whitespace from all non-empty lines. Leading/trailing blank lines are trimmed.

func RandAlpha

func RandAlpha(n int) string

RandAlpha returns a random mixed-case alphabetic string of length n.

func RandAlphaNum

func RandAlphaNum(n int) string

RandAlphaNum returns a random alphanumeric string of length n.

func RandBool

func RandBool() bool

RandBool returns a random boolean.

func RandBytes

func RandBytes(n int) []byte

RandBytes returns n cryptographically random bytes.

func RandElement

func RandElement(items []string) string

RandElement returns a random element from a string slice.

func RandHex

func RandHex(n int) string

RandHex returns a random hex string of length n.

func RandInt

func RandInt(low, high int) int

RandInt returns a random integer in [low, high).

func RandNumeric

func RandNumeric(n int) string

RandNumeric returns a random numeric string of length n.

func RandText

func RandText(n int) string

RandText returns a random lowercase alphabetic string of length n.

func RandUserAgent

func RandUserAgent() string

RandUserAgent generates a random realistic browser user agent string. Assembles components dynamically instead of picking from a static list.

Types

This section is empty.

Jump to

Keyboard shortcuts

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