Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-22T15:18:23.000Z (almost 2 years ago)
- Last Synced: 2024-10-29T20:29:54.426Z (3 months 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
[![GitHub go.mod Go version of a Go module](https://img.shields.io/github/go-mod/go-version/gowizzard/goten.svg)](https://golang.org/) [![Go](https://github.com/gowizzard/goten/actions/workflows/go.yml/badge.svg)](https://github.com/gowizzard/goten/actions/workflows/go.yml) [![CodeQL](https://github.com/gowizzard/goten/actions/workflows/codeql.yml/badge.svg)](https://github.com/gowizzard/goten/actions/workflows/codeql.yml) [![CompVer](https://github.com/gowizzard/goten/actions/workflows/compver.yml/badge.svg)](https://github.com/gowizzard/goten/actions/workflows/compver.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/gowizzard/goten)](https://goreportcard.com/report/github.com/gowizzard/goten) [![Go Reference](https://pkg.go.dev/badge/github.com/gowizzard/goten.svg)](https://pkg.go.dev/github.com/gowizzard/goten) [![GitHub issues](https://img.shields.io/github/issues/gowizzard/goten)](https://github.com/gowizzard/goten/issues) [![GitHub forks](https://img.shields.io/github/forks/gowizzard/goten)](https://github.com/gowizzard/goten/network) [![GitHub stars](https://img.shields.io/github/stars/gowizzard/goten)](https://github.com/gowizzard/goten/stargazers) [![GitHub license](https://img.shields.io/github/license/gowizzard/goten)](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)
```