33 public const QUICK_RAND = 0;
35 public const QUICK_VOLATILE = GlobalIdGenerator::QUICK_VOLATILE;
53 $gen = MediaWikiServices::getInstance()->getGlobalIdGenerator();
55 return $gen->newTimestampedUID88(
$base );
73 $gen = MediaWikiServices::getInstance()->getGlobalIdGenerator();
75 return $gen->newTimestampedUID128(
$base );
86 $gen = MediaWikiServices::getInstance()->getGlobalIdGenerator();
88 return $gen->newUUIDv1();
99 $gen = MediaWikiServices::getInstance()->getGlobalIdGenerator();
101 return $gen->newRawUUIDv1();
112 $gen = MediaWikiServices::getInstance()->getGlobalIdGenerator();
114 return $gen->getTimestampFromUUIDv1( $uuid, $format );
125 $gen = MediaWikiServices::getInstance()->getGlobalIdGenerator();
127 return $gen->newUUIDv4();
138 $gen = MediaWikiServices::getInstance()->getGlobalIdGenerator();
140 return $gen->newRawUUIDv4();
156 $gen = MediaWikiServices::getInstance()->getGlobalIdGenerator();
158 return $gen->newSequentialPerNodeID( $bucket, $bits, $flags );
173 $gen = MediaWikiServices::getInstance()->getGlobalIdGenerator();
175 return $gen->newSequentialPerNodeIDs( $bucket, $bits, $count, $flags );
Class for getting statistically unique IDs.
static newRawUUIDv1()
Return an RFC4122 compliant v1 UUID.
static newSequentialPerNodeID( $bucket, $bits=48, $flags=0)
Return an ID that is sequential only for this node and bucket.
static newSequentialPerNodeIDs( $bucket, $bits, $count, $flags=0)
Return IDs that are sequential only for this node and bucket.
static newRawUUIDv4( $flags=0)
Return an RFC4122 compliant v4 UUID.
static newUUIDv4( $flags=0)
Return an RFC4122 compliant v4 UUID.
static newUUIDv1()
Return an RFC4122 compliant v1 UUID.
static newTimestampedUID128( $base=10)
Get a statistically unique 128-bit unsigned integer ID string.
static getTimestampFromUUIDv1(string $uuid, int $format=TS_MW)
Get timestamp in a specified format from UUIDv1.
static newTimestampedUID88( $base=10)
Get a statistically unique 88-bit unsigned integer ID string.