random

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminName added in v0.92.0

func AdminName() string

AdminName returns admin name acceptable by Snowflake: 090088 (22000): ADMIN_NAME can only contain letters, numbers and underscores. 090089 (22000): ADMIN_NAME must start with a letter.

func AlphaLowerN added in v1.0.0

func AlphaLowerN(num int) string

func AlphaN

func AlphaN(num int) string

func AlphanumericN

func AlphanumericN(num int) string

func Bool

func Bool() bool

func Bytes added in v1.0.5

func Bytes() []byte

func Comment

func Comment() string

func Email added in v0.94.0

func Email() string

func GenerateRSAKeyPair added in v1.0.0

func GenerateRSAKeyPair(t *testing.T, pass string) (string, string, string, string)

GenerateRSAKeyPair returns an RSA private key (unencrypted and encrypted), RSA public key without BEGIN and END markers, and key's hash.

func GenerateRSAPrivateKey added in v0.98.0

func GenerateRSAPrivateKey(t *testing.T) *rsa.PrivateKey

GenerateRSAPrivateKey returns an RSA private key.

func GenerateRSAPrivateKeyEncrypted added in v0.98.0

func GenerateRSAPrivateKeyEncrypted(t *testing.T, password string) (unencrypted, encrypted string)

GenerateRSAPrivateKeyEncrypted returns a PEM-encoded pair of unencrypted and encrypted key with a given password

func GenerateRSAPublicKey added in v0.92.0

func GenerateRSAPublicKey(t *testing.T) (string, string)

GenerateRSAPublicKey returns an RSA public key without BEGIN and END markers, and key's hash.

func GenerateRSAPublicKeyFromPrivateKey added in v1.0.0

func GenerateRSAPublicKeyFromPrivateKey(t *testing.T, key *rsa.PrivateKey) (string, string)

GenerateRSAPublicKeyFromPrivateKey returns an RSA public key without BEGIN and END markers, and key's hash.

func GenerateX509 added in v0.92.0

func GenerateX509(t *testing.T) string

GenerateX509 returns base64 encoded certificate on a single line without the leading -----BEGIN CERTIFICATE----- and ending -----END CERTIFICATE----- markers.

func ObjectSuffix added in v1.0.5

func ObjectSuffix() string

func Password added in v0.92.0

func Password() string

func SensitiveAlpha added in v1.2.0

func SensitiveAlpha() string

SensitiveAlpha returns a random string prefixed with a generated random value that is masked in GitHub Action logs. The string returned by SensitiveAlphanumeric always starts with a letter and contains only letters.

func SensitiveAlphanumeric added in v1.2.0

func SensitiveAlphanumeric() string

SensitiveAlphanumeric returns a random string prefixed with a generated random value that is masked in GitHub Action logs. The string returned by SensitiveAlphanumeric always starts with a letter and contains only letters and numbers.

func SensitiveString added in v1.2.0

func SensitiveString() string

SensitiveString returns a random string prefixed with a generated random value that is masked in GitHub Action logs. The string returned by SensitiveString always starts with a letter and contains only letters, numbers, and symbols.

func String

func String() string

func StringN

func StringN(num int) string

func UUID

func UUID() string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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