https://github.com/gowizzard/goten
To create a random token with the length you want. The random seed is based on the current time with nano seconds.
https://github.com/gowizzard/goten
generator go golang password random token
Last synced: 6 months ago
JSON representation
To create a random token with the length you want. The random seed is based on the current time with nano seconds.
- Host: GitHub
- URL: https://github.com/gowizzard/goten
- Owner: gowizzard
- License: mit
- Created: 2020-12-30T20:42:26.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-02-22T15:18:23.000Z (over 3 years ago)
- Last Synced: 2025-02-05T02:43:31.449Z (over 1 year ago)
- Topics: generator, go, golang, password, random, token
- Language: Go
- Homepage:
- Size: 53.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Random token
[](https://golang.org/) [](https://github.com/gowizzard/goten/actions/workflows/go.yml) [](https://github.com/gowizzard/goten/actions/workflows/codeql.yml) [](https://github.com/gowizzard/goten/actions/workflows/compver.yml) [](https://goreportcard.com/report/github.com/gowizzard/goten) [](https://pkg.go.dev/github.com/gowizzard/goten) [](https://github.com/gowizzard/goten/issues) [](https://github.com/gowizzard/goten/network) [](https://github.com/gowizzard/goten/stargazers) [](https://github.com/gowizzard/goten/blob/master/LICENSE)
To create a random token in Golang. Based on letters, numbers and symbols. Created with a non-negative pseudo-random number based on a random seed with is created with unix time number of nanoseconds.
## Install
First you have to install the package. You can do this as follows:
```console
go get github.com/gowizzard/goten
```
## How to use
Here is a small example how to create a random password without numbers and symbols. Only letters.
```go
token := goten.Generate(50, nil)
fmt.Println(token)
```
And here is a small example how to create a random token with numbers and symbols.
```go
options := goten.Options{
Uppercase: true,
Numbers: true,
Symbols: true,
}
token := goten.Generate(50, &options)
fmt.Println(token)
```