zbiljic / rands

Random string generator for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rands

GoDoc License

Package rands provides functions for generating random strings in Go (golang).

It combines math/rand with crypto/rand for acceptable ratio of performance/security.

Installation

go get -u github.com/zbiljic/rands

Example:

import "github.com/zbiljic/rands"

rands.AlphanumericString(64) // returns random string with 64 alpha-numeric characters
rands.AlphabeticString(32)   // returns random string with 32 alphabetic characters
rands.NumericString(16)      // returns random string with 16 numeric characters

See the reference for more info.


Copyright © 2017 Nemanja Zbiljić

About

Random string generator for Go

License:MIT License


Languages

Language:Go 100.0%