rand

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: MIT Imports: 1 Imported by: 0

README

rand

generator for random string

Release MIT license Go.Dev reference

Usage

install it by the following command if it is need to use the random library,

go get github.com/dot1024/rand@latest

random gen tool command with a command such as

go install github.com/dot1024/rand/rand-gen@latest

command introduction:

Usage of ./build/rand-gen:
-rl int
        length of random string (default 10)
-rt string
        type of random string, options value is 1000, 0100, 0010, 0001 (default "1")
-vb
        show all additional information

command example

# generate random string by default, source is numeric characters, random length is 10
rand-gen

# args: rt is binary number (as string), base value is belowing:
#   (8) 1000 for special characters
#   (4) 0100 for uppercase letters
#   (2) 0010 for lowercase letters
#   (1) 0001 for numeric characters
# then rt values eg:
#   0001 <- 1
#   0010 <- 2
#   0100 <- 4
#   1000 <- 8
#   1100 <- 8|4
#   0110 <- 4|2
#   0011 <- 2|1
#   1001 <- 8|1
#   1110 <- 8|4|2
#   1101 <- 8|4|1
#   1111 <- 8|4|2|1
#   1111 <- 8|4|2|1
#   ......

# source is special string, random length is 10
rand-gen -rt 0001 -rl 10

# source is lowercase letters, random length is 10
rand-gen -rt 0010 -rl 10

# source is uppercase letters, random length is 10
rand-gen -rt 0100 -rl 10

# source is special characters, random length is 10
rand-gen -rt 1000 -rl 10

I hope the tool will help all those who need it. Good luck!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenAll added in v1.0.1

func GenAll(b []byte)

GenAll generate random data using all of string

func GenLetter added in v1.0.1

func GenLetter(b []byte)

GenLetter generate random data using letters

func GenLower added in v1.0.1

func GenLower(b []byte)

GenLetter generate random data with lower letters

func GenNum added in v1.0.1

func GenNum(b []byte)

GenLetter generate random data using number strings

func GenUpper added in v1.0.1

func GenUpper(b []byte)

GenLetter generate random data with upper letters

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