All Projects → ernsheong → grand

ernsheong / grand

Licence: MIT license
Grand is a Go random string generator

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to grand

strgen
A Python module for a template language that generates randomized data
Stars: ✭ 34 (+183.33%)
Mutual labels:  random, random-string, string-generator
jRand
A Java library to generate random data for all sorts of things. Java random data faker
Stars: ✭ 27 (+125%)
Mutual labels:  random, random-string
Jnanoid
A unique string ID generator for Java.
Stars: ✭ 147 (+1125%)
Mutual labels:  random
Rantly
Ruby Imperative Random Data Generator and Quickcheck
Stars: ✭ 241 (+1908.33%)
Mutual labels:  random
Rrt Algorithms
n-dimensional RRT, RRT* (RRT-Star)
Stars: ✭ 195 (+1525%)
Mutual labels:  random
Randomdata
Random data generator
Stars: ✭ 157 (+1208.33%)
Mutual labels:  random
Mgodatagen
Generate random data for MongoDB
Stars: ✭ 206 (+1616.67%)
Mutual labels:  random
Generatedata
A powerful, feature-rich, random test data generator.
Stars: ✭ 1,883 (+15591.67%)
Mutual labels:  random
movies-dataset
A dataset of films, directors, actresses and actors
Stars: ✭ 17 (+41.67%)
Mutual labels:  random
Insight
🔮 Easy access to model information for various model objects
Stars: ✭ 197 (+1541.67%)
Mutual labels:  random
Reeseunitydemos
Unity packages and demos—emphasizing ECS, jobs and the Burst compiler—by me, Reese.
Stars: ✭ 232 (+1833.33%)
Mutual labels:  random
Qcheck
QuickCheck inspired property-based testing for OCaml.
Stars: ✭ 194 (+1516.67%)
Mutual labels:  random
Rocket
ROCKET: Exceptionally fast and accurate time series classification using random convolutional kernels
Stars: ✭ 163 (+1258.33%)
Mutual labels:  random
Mathnet Numerics
Math.NET Numerics
Stars: ✭ 2,688 (+22300%)
Mutual labels:  random
Randomatic
Easily generate random strings like passwords, with simple options for specifying a length and for using patterns of numeric, alpha-numeric, alphabetical, special or custom characters. (the original "generate-password")
Stars: ✭ 149 (+1141.67%)
Mutual labels:  random
Python Gift Exchange
pyge: Holiday Gift Exchange Picker
Stars: ✭ 252 (+2000%)
Mutual labels:  random
Pandemonium
Typical random-related functions for JavaScript and TypeScript.
Stars: ✭ 144 (+1100%)
Mutual labels:  random
Nanoid
A tiny, secure, URL-friendly, unique string ID generator for Rust
Stars: ✭ 188 (+1466.67%)
Mutual labels:  random
Sometimes
A few hacks n' helpers to make your code more fun and unpredictable.
Stars: ✭ 198 (+1550%)
Mutual labels:  random
aes-stream
A fast AES-PRF based secure random-number generator
Stars: ✭ 15 (+25%)
Mutual labels:  random

Grand

GoDoc

Grand is a Go random string generator.

Installation

go get github.com/ernsheong/grand

Usage

  1. IMPORTANT. Seed rand first to ensure you don't get the same string on every code run (initialize):

    rand.Seed(time.Now().UTC().UnixNano())

    or

    rand.Seed(time.Now().Unix())
  2. Generate your random string, given a length parameter n:

    grand.GenerateRandomString(32)
    // returns "qzrWbaoLTVpQoottZyPFfNOoMioXHRuF"
  3. Generate random string from other character sets:

    gen := grand.NewGenerator(grand.CharSetBase62)
    gen.GenerateRandomString(20)
    // returns "q3rWba2LTVpQ4ottZyPv"

Concurrency

From the math/rand docs:

The default Source is safe for concurrent use by multiple goroutines

grand uses the default Source, and hence is safe to be called from multiple goroutines, at a slight performance penalty. See https://stackoverflow.com/a/31832326/1161743 for details.

Credits

I claim no credit for the generation logic. It's originally from user icza in https://stackoverflow.com/a/31832326/1161743.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].