TimestampFirstCombCodec
class TimestampFirstCombCodec extends StringCodec (View source)
TimestampLastCombCodec encodes and decodes COMB UUIDs which have the timestamp as the first 48 bits.
To be used with MySQL, PostgreSQL, Oracle.
Methods
Constructs a StringCodec for use encoding and decoding UUIDs
Encodes a UuidInterface as a string representation of a timestamp first COMB UUID
Encodes a UuidInterface as a binary representation of timestamp first COMB UUID
Decodes a string representation of timestamp first COMB UUID into a UuidInterface object instance
Decodes a binary representation of timestamp first COMB UUID into a UuidInterface object instance
Returns an array of UUID components (the UUID exploded on its dashes)
Swaps the first 48 bits with the last 48 bits
Details
in StringCodec at line 40
__construct(UuidBuilderInterface $builder)
Constructs a StringCodec for use encoding and decoding UUIDs
at line 31
string
encode(UuidInterface $uuid)
Encodes a UuidInterface as a string representation of a timestamp first COMB UUID
at line 50
string
encodeBinary(UuidInterface $uuid)
Encodes a UuidInterface as a binary representation of timestamp first COMB UUID
at line 64
UuidInterface
decode(string $encodedUuid)
Decodes a string representation of timestamp first COMB UUID into a UuidInterface object instance
at line 80
UuidInterface
decodeBytes(string $bytes)
Decodes a binary representation of timestamp first COMB UUID into a UuidInterface object instance
in StringCodec at line 108
protected UuidBuilderInterface
getBuilder()
Returns the UUID builder
in StringCodec at line 119
protected array
extractComponents(string $encodedUuid)
Returns an array of UUID components (the UUID exploded on its dashes)
in StringCodec at line 156
protected array
getFields(array $components)
Returns the fields that make up this UUID
at line 92
protected void
swapTimestampAndRandomBits(array $components)
Swaps the first 48 bits with the last 48 bits