random

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package random provides utilities for generating random strings and numbers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Bytes

func Base64Bytes(n int) string

Base64Bytes returns n cryptographically-random bytes encoded as standard base64 (with padding). Used for ss2022 keys, which xray expects as a base64-encoded key of a specific byte length per cipher.

func Num

func Num(n int) int

Num generates a random integer between 0 and n-1.

func NumLower

func NumLower(n int) string

NumLower generates a random string of length n containing digits and lowercase letters only.

func Seq

func Seq(n int) string

Seq generates a random string of length n containing alphanumeric characters (numbers, lowercase and uppercase letters).

Types

This section is empty.

Jump to

Keyboard shortcuts

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