https://github.com/tamboto2000/random
Random is a small library for generating random strings
https://github.com/tamboto2000/random
random-hex random-string random-string-generators
Last synced: about 2 months ago
JSON representation
Random is a small library for generating random strings
- Host: GitHub
- URL: https://github.com/tamboto2000/random
- Owner: tamboto2000
- License: mit
- Created: 2020-07-16T08:27:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-10T21:20:15.000Z (over 5 years ago)
- Last Synced: 2023-07-27T15:06:33.070Z (over 2 years ago)
- Topics: random-hex, random-string, random-string-generators
- Language: Go
- Homepage: https://pkg.go.dev/github.com/tamboto2000/random
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Random
[](https://pkg.go.dev/github.com/tamboto2000/random)
Random is a small library for generating random strings.
# Features
- Generate hexadecimals string
- Generate string with options (include uppercase, numbers, and symbols)
### Installation
```sh
$ go get github.com/tamboto2000/random
```
### Example
```go
package main
import (
"fmt"
"github.com/tamboto2000/random"
)
func main() {
// generate random string
fmt.Println(random.RandStr(20))
// generate random string with option
fmt.Println(random.RandStrWithOpt(20, random.Option{
IncludeNumber: true,
IncludeUpperCase: true,
// IncludeSymbols: true,
}))
// generate random hexadecimals string
fmt.Println(random.RandHexStr(20))
}
```
License
----
MIT