A simple wrapper for math/rand
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
mrand.go
mrand_test.go
readme.md

readme.md

GoDoc shields.io shields.io

mrand

Overview

Package mrand is a simple wrapper for math/rand.

Index

Package files

mrand.go

Constants

const (
    MaxInt32 = 1<<31 - 1
    MaxInt64 = 1<<63 - 1
)

func Int

func Int(a ...int) int

Int returns a random non-negative 32 bit integer.

Example:
rnd := mrand.Int()        // return a random int between 0 and MaxInt32 inclusive
rnd := mrand.Int(90,99)   // return a random int between 90 and 99 inclusive

func Int64

func Int64(a ...int64) int64

Int64 returns a random non-negative 64 bit integer.

Example:
rnd := mrand.Int64()        // return a random int64 between 0 and MaxInt64 inclusive
rnd := mrand.Int64(90,99)   // return a random int64 between 90 and 99 inclusive

func String

func String(n int) string

String returns a random alpha-numeric string of length n.

Example:
str := mrand.String(64)

Generated by godoc2md