unket

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2019 License: MIT Imports: 4 Imported by: 1

README

Unket: Unique Number basKET

Package unket implements the unket (Unique Number basKET) data type. See GoDoc for details.

Documentation

Overview

Package unket implements the unket (Unique Number basKET) data type.

But what is an unket?

Well, an unket is an abstract basket. It contains unique whole numbers (1 <= x <= infinity), and numbers can be picked out of the basket. Number picking is done randomly.

But of what use if this?

Unkets are used whenever deemed appropriate, but one common example is: when you want to randomly pick an element from an array.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Unket

type Unket struct {
	// contains filtered or unexported fields
}

func New

func New(n int64) (*Unket, error)

Function New () creates a new unket. Its argument should be the number of numbers you want the unket to contain.

func (Unket) Pick

func (n Unket) Pick() (o *big.Int, e error)

Function Pick () helps pick a number at random. If there is no more number to pick, nil would be returned.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL