Documentation

CombGenerator
in package
implements RandomGeneratorInterface

CombGenerator provides functionality to generate COMB (combined GUID/timestamp) sequential UUIDs

Tags
link
https://en.wikipedia.org/wiki/Globally_unique_identifier#Sequential_algorithms

Interfaces, Classes and Traits

RandomGeneratorInterface
RandomGeneratorInterface provides functionality to generate strings of random binary data

Table of Contents

TIMESTAMP_BYTES  = 6
$converter  : NumberConverterInterface
$randomGenerator  : RandomGeneratorInterface
__construct()  : mixed
Constructs a `CombGenerator` using a random-number generator and a number converter
generate()  : string
Generates a string of binary data of the specified length
timestamp()  : string
Returns current timestamp as integer, precise to 0.00001 seconds

Constants

Properties

Methods

generate()

Generates a string of binary data of the specified length

public generate(int $length) : string
Parameters
$length : int

The number of bytes of random binary data to generate

Tags
throws
UnsatisfiedDependencyException

if Moontoast\Math\BigNumber is not present

throws
InvalidArgumentException

if length is not a positive integer

throws
Exception
Return values
string

A binary string

timestamp()

Returns current timestamp as integer, precise to 0.00001 seconds

private timestamp() : string
Return values
string

Search results