computation

package
v0.0.0-...-b32a2c2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2018 License: GPL-3.0 Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputePrimes

func ComputePrimes(lastPrime *big.Int, writeToFile bool, toInfinity bool, maxNumber *big.Int)

ComputePrimes computes primes concurrently until KeyboardInterrupt

func GenerateUUID

func GenerateUUID() uuid.UUID

GenerateUUID generates a new, random UUID (v4)

func GetUnMarshalledPrime

func GetUnMarshalledPrime(body string) primes.Prime

GetUnMarshalledPrime produces a computation from a JSON string

func RunDistributedComputation

func RunDistributedComputation(c Computation) bool

RunDistributedComputation calculates the modulus of a given Computation

Types

type Computation

type Computation struct {
	Prime         primes.Prime
	Divisor       *big.Int
	IsValid       bool
	TimeTaken     time.Duration
	ComputationId *big.Int
	Hash          uuid.UUID
}

func GetComputationsToPerform

func GetComputationsToPerform(prime primes.Prime) []Computation

GetComputationsToPerform passes all computations needed to be performed to a channel

Jump to

Keyboard shortcuts

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