Skip to content

gosimple/srand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

srand - simple rand

Package srand simplify choosing random values.

Documentation online

package main

import (
	"github.com/gosimple/srand"
	"fmt"
)

func main() {
	fmt.Println(srand.Int(10, 20))          // 12
	fmt.Println(srand.IntMany(10, 20, 3))   // [17 17 13]
	fmt.Println(srand.IntSample(10, 20, 3)) // [20 14 12]

	fmt.Println(srand.String(10, 15))                // aaYCKpwvRhsZz
	fmt.Println(srand.StringA(10, 15, "abc"))        // aaaabcbbbab
	fmt.Println(srand.StringA(10, 15, srand.BASE85)) // T$a~(#HTQ>7q
}

Requests or bugs?

https://github.com/gosimple/srand/issues

Installation

go get -u github.com/gosimple/srand

License

The source files are distributed under the Mozilla Public License, version 2.0, unless otherwise noted. Please read the FAQ if you have further questions regarding the license.

About

Choosing randomness simplified

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages