siteah.blogg.se

Random uuid generator
Random uuid generator




random uuid generator random uuid generator
  1. #Random uuid generator generator#
  2. #Random uuid generator mac#

Returns a UUID packed into a 16 byte string. If no version is specified, it defaults to "4". The only allowed versions are "1", "4" and "4s".

#Random uuid generator generator#

METHODS new my $ug = Data::UUID::MT->new( version => 4 ) Ĭreates a UUID generator object. This module focuses on generation of UUIDs with random elements and does not support UUID versions 2, 3 and 5. This UUID has 60 timestamp bits, 62 pseudo-random bits and 6 mandated bits ("variant" field and "version" field). This "4s" variant provides a "sequential UUID" with the timestamp providing order and the remaining random bits making collision with other UUIDs created at the exact same microsecond highly unlikely. This is a custom UUID form that resembles "version 4" form, but that overlays the first 60 bits with a timestamp akin to "version 1", Unlike "version 1", this custom version preserves the ordering of bits from high to low, whereas "version 1" puts the low 32 bits of the timestamp first, then the middle 16 bits, then multiplexes the high bits with version field. The UUID follows the "version 4" spec, with 122 pseudo-random bits and 6 mandated bits ("variant" field and "version" field). This UUID has 60 bits of timestamp data, 61 bits of pseudo-random data and 7 mandated bits (multicast bit, "variant" field and "version" field).

#Random uuid generator mac#

(This is permissible within the spec of the RFC.) The generated MAC address has the the multicast bit set as mandated by the RFC to ensure it does not conflict with real MAC addresses. The UUID generally follows the "version 1" spec from the RFC, however the clock sequence and MAC address are randomly generated each time. Pseudo-random UUIDs are not recommended for use as security authentication tokens in cookies or other user-visible session identifiers. Note: The Mersenne Twister pseudo-random number generator has excellent statistical properties, but it is not considered cryptographically secure. Two are consistent with RFC 4122 and one is a custom variant that provides a 'sequential UUID' that can be advantageous when used as a primary database key. Three different types of UUIDs are supported. This UUID generator uses the excellent Math::Random::MT::Auto module as a source of fast, high-quality (pseudo) random numbers. # iterator - avoids some method call overhead My $uuid1 = $ug->create() # 16 byte binary string My $ug2 = Data::UUID::MT->new() # default is "4" Version 1.001 SYNOPSIS use Data::UUID::MT Data::UUID::MT - Fast random UUID generator using the Mersenne Twister algorithm VERSION






Random uuid generator