id

package
v0.0.0-...-28009d5 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenSafeUniqueSlug

func GenSafeUniqueSlug(slug string) string

GenSafeUniqueSlug generatees a reasonably unique random slug from the given original slug. It's "safe" because it uses 0-9 b-z excluding vowels.

func Generate62RandomString

func Generate62RandomString(l int) string

Generate62RandomString creates a random string with the given length consisting of characters in [A-Za-z0-9].

func GenerateFriendlyRandomString

func GenerateFriendlyRandomString(l int) string

GenerateFriendlyRandomString creates a random string of characters with the given length consisting of characters in [a-z0-9].

func GenerateRandomString

func GenerateRandomString(dictionary string, l int) string

GenerateRandomString creates a random string of characters of the given length from the given dictionary of possible characters.

This example generates a hexadecimal string 6 characters long:

GenerateRandomString("0123456789abcdef", 6)

Types

This section is empty.

Jump to

Keyboard shortcuts

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