Acme-CPANModules-UUID
view release on metacpan or search on metacpan
create v1 as well as v4 (random) UUIDs. Note that Data::UUID
(XS-based) is faster this module (FFI-based).
The benchmark code creates 1000+1 v1 string UUIDs.
UUID::Tiny
Author: CAUGUSTIN <https://metacpan.org/author/CAUGUSTIN>
This module should be your go-to choice if you cannot use an XS
module. It can create v1, v3, v4 UUIDs. However, the random v4 UUIDs
are not cryptographically secure; if you need cryptographically
secure random UUIDs, use Crypt::Misc.
The benchmark code creates 1000+1 v1 string UUIDs.
See also: Types::UUID which is a type library that uses Data::UUID
as the backend.
UUID::Random
Author: PERLER <https://metacpan.org/author/PERLER>
This module simply uses 32 calls to Perl's rand() to construct each
random hexadecimal digits of the UUID (v4). Not really recommended,
since perl's default pseudo-random generator is neither
cryptographically secure nor has 128 bit of entropy. It also does
not produce v4 UUIDs that conform to RFC 4122 (no encoding of
variant & version information).
To create a cryptographically secure random UUIDs, use Crypt::Misc.
The benchmark code creates 1000+1 v4 string UUIDs.
UUID::Random::PERLANCAR
Author: PERLANCAR <https://metacpan.org/author/PERLANCAR>
Just another implementation of UUID::Random.
The benchmark code creates 1000+1 v4 string UUIDs.
UUID
Author: JRM <https://metacpan.org/author/JRM>
This module generates DCE-compatible UUIDs, which according to RFC
belongs to the legacy variants.
The benchmark creates 1000+1 random UUIDs.
ACME::CPANMODULES FEATURE COMPARISON MATRIX
+-------------------------+-----------+-----------+-----------+-----------+-----------+-------+-------+----------------+----------------------+---------------+
| module | create_v1 | create_v2 | create_v3 | create_v4 | create_v5 | is_pp | is_xs | v4_rfc4122 *1) | v4_secure_random *2) | create_legacy |
+-------------------------+-----------+-----------+-----------+-----------+-----------+-------+-------+----------------+----------------------+---------------+
| Data::UUID | yes | yes | no | no | no | no | yes | N/A | N/A | N/A |
| UUID::FFI | yes | no | no | yes | no | no | yes | yes | no | N/A |
| UUID::Tiny | yes | no | yes | yes | yes | yes | no | yes | no | N/A |
| UUID::Random | no | no | no | yes | no | yes | no | no | no | N/A |
| UUID::Random::PERLANCAR | no | no | no | yes | no | yes | no | yes | no | N/A |
| UUID::Random::Secure | no | no | no | yes | no | yes | no | yes | yes | N/A |
| Crypt::Misc | no | no | no | yes | no | yes | no | yes | yes | N/A |
| UUID | no | no | no | no | no | no | yes | no | no | yes |
+-------------------------+-----------+-----------+-----------+-----------+-----------+-------+-------+----------------+----------------------+---------------+
Notes:
1. v4_rfc4122: Whether the generated v4 UUID follows RFC 4122
specification (i.e. encodes variant and version information in M & N
positions)
2. v4_secure_random: Whether the module uses cryptographically secure
pseudo-random number generator for v4 UUIDs
BENCHMARKED MODULES
Version numbers shown below are the versions used when running the
sample benchmark.
Data::UUID 1.226
UUID::FFI 0.11
lib/Acme/CPANModules/UUID.pm view on Meta::CPAN
<pm:Data::UUID> should be your first choice, and when you cannot install XS
modules you can use <pm:UUID::Tiny> instead.
Aside from the modules listed as entries below, there are also:
<pm:App::UUIDUtils> (containing CLIs to create/check UUID), <pm:Data::GUID>
(currently just a wrapper for Data::UUID).
MARKDOWN
entry_features => {
v4_rfc4122 => {summary => 'Whether the generated v4 UUID follows RFC 4122 specification (i.e. encodes variant and version information in M & N positions)'},
v4_secure_random => {summary => 'Whether the module uses cryptographically secure pseudo-random number generator for v4 UUIDs'},
},
entries => [
{
module => 'Data::UUID',
description => <<'MARKDOWN',
This module creates v1 and v2 UUIDs. Depending on the OS, for MAC address, it
usually uses a hash of hostname instead. This module is XS, so performance is
good. If you cannot use an XS module, try <pm:UUID::Tiny> instead.
lib/Acme/CPANModules/UUID.pm view on Meta::CPAN
MARKDOWN
bench_code_template => 'UUID::FFI->new_time for 1..1000; UUID::FFI->new_time->as_hex',
features => {
is_xs => 1,
is_pp => 0,
create_v1 => 1,
create_v2 => 0,
create_v3 => 0,
create_v4 => 1,
v4_secure_random => 0,
v4_rfc4122 => 1,
create_v5 => 0,
},
},
{
module => 'UUID::Tiny',
description => <<'MARKDOWN',
This module should be your go-to choice if you cannot use an XS module. It can
create v1, v3, v4 UUIDs. However, the random v4 UUIDs are not cryptographically
secure; if you need cryptographically secure random UUIDs, use <pm:Crypt::Misc>.
The benchmark code creates 1000+1 v1 string UUIDs.
See also: <pm:Types::UUID> which is a type library that uses Data::UUID as the
backend.
MARKDOWN
bench_code_template => 'UUID::Tiny::create_uuid() for 1..1000; UUID::Tiny::uuid_to_string(UUID::Tiny::create_uuid())',
features => {
is_xs => 0,
is_pp => 1,
create_v1 => 1,
create_v2 => 0,
create_v3 => 1,
create_v4 => 1,
v4_secure_random => 0,
v4_rfc4122 => 1,
create_v5 => 1,
},
},
{
module => 'UUID::Random',
description => <<'MARKDOWN',
This module simply uses 32 calls to Perl's C<rand()> to construct each random
hexadecimal digits of the UUID (v4). Not really recommended, since perl's
default pseudo-random generator is neither cryptographically secure nor has 128
bit of entropy. It also does not produce v4 UUIDs that conform to RFC 4122 (no
encoding of variant & version information).
To create a cryptographically secure random UUIDs, use <pm:Crypt::Misc>.
The benchmark code creates 1000+1 v4 string UUIDs.
MARKDOWN
bench_code_template => 'UUID::Random::generate() for 1..1000; ; UUID::Random::generate()',
features => {
is_xs => 0,
is_pp => 1,
create_v1 => 0,
create_v2 => 0,
create_v3 => 0,
create_v4 => 1,
v4_secure_random => 0,
v4_rfc4122 => 0,
create_v5 => 0,
},
},
{
module => 'UUID::Random::PERLANCAR',
description => <<'MARKDOWN',
Just another implementation of <pm:UUID::Random>.
lib/Acme/CPANModules/UUID.pm view on Meta::CPAN
The benchmark code creates 1000+1 v4 string UUIDs.
MARKDOWN
features => {
is_xs => 0,
is_pp => 1,
create_v1 => 0,
create_v2 => 0,
create_v3 => 0,
create_v4 => 1,
v4_secure_random => 0,
v4_rfc4122 => 1,
create_v5 => 0,
},
functions => {
generate => {
bench_code_template => 'UUID::Random::PERLANCAR::generate() for 1..1000; UUID::Random::PERLANCAR::generate()',
},
generate_rfc => {
bench_code_template => 'UUID::Random::PERLANCAR::generate_rfc() for 1..1000; UUID::Random::PERLANCAR::generate_rfc()',
},
lib/Acme/CPANModules/UUID.pm view on Meta::CPAN
The benchmark code creates 1000+1 v4 string UUIDs.
MARKDOWN
features => {
is_xs => 0,
is_pp => 1,
create_v1 => 0,
create_v2 => 0,
create_v3 => 0,
create_v4 => 1,
v4_secure_random => 1,
v4_rfc4122 => 1,
create_v5 => 0,
},
functions => {
generate => {
bench_code_template => 'UUID::Random::Secure::generate() for 1..1000; UUID::Random::Secure::generate()',
},
generate_rfc => {
bench_code_template => 'UUID::Random::Secure::generate_rfc() for 1..1000; UUID::Random::Secure::generate_rfc()',
},
lib/Acme/CPANModules/UUID.pm view on Meta::CPAN
MARKDOWN
bench_code_template => 'Crypt::Misc::random_v4uuid() for 1..1000; Crypt::Misc::random_v4uuid()',
features => {
is_xs => 0,
is_pp => 1,
create_v1 => 0,
create_v2 => 0,
create_v3 => 0,
create_v4 => 1,
v4_secure_random => 1,
v4_rfc4122 => 1,
create_v5 => 0,
},
},
{
module => 'UUID',
description => <<'MARKDOWN',
This module generates DCE-compatible UUIDs, which according to RFC belongs to
lib/Acme/CPANModules/UUID.pm view on Meta::CPAN
MARKDOWN
bench_code_template => 'my $uuid; UUID::generate_random($uuid) for 1..1000; UUID::generate_random($uuid); $uuid',
features => {
is_xs => 1,
is_pp => 0,
create_v1 => 0,
create_v2 => 0,
create_v3 => 0,
create_v4 => 0,
v4_secure_random => 0,
v4_rfc4122 => 0,
create_v5 => 0,
create_legacy => 1,
},
},
],
};
1;
lib/Acme/CPANModules/UUID.pm view on Meta::CPAN
The benchmark code creates 1000+1 v1 string UUIDs.
=item L<UUID::Tiny>
Author: L<CAUGUSTIN|https://metacpan.org/author/CAUGUSTIN>
This module should be your go-to choice if you cannot use an XS module. It can
create v1, v3, v4 UUIDs. However, the random v4 UUIDs are not cryptographically
secure; if you need cryptographically secure random UUIDs, use L<Crypt::Misc>.
The benchmark code creates 1000+1 v1 string UUIDs.
See also: L<Types::UUID> which is a type library that uses Data::UUID as the
backend.
=item L<UUID::Random>
Author: L<PERLER|https://metacpan.org/author/PERLER>
This module simply uses 32 calls to Perl's C<rand()> to construct each random
hexadecimal digits of the UUID (v4). Not really recommended, since perl's
default pseudo-random generator is neither cryptographically secure nor has 128
bit of entropy. It also does not produce v4 UUIDs that conform to RFC 4122 (no
encoding of variant & version information).
To create a cryptographically secure random UUIDs, use L<Crypt::Misc>.
The benchmark code creates 1000+1 v4 string UUIDs.
=item L<UUID::Random::PERLANCAR>
Author: L<PERLANCAR|https://metacpan.org/author/PERLANCAR>
Just another implementation of L<UUID::Random>.
lib/Acme/CPANModules/UUID.pm view on Meta::CPAN
the legacy variants.
The benchmark creates 1000+1 random UUIDs.
=back
=head1 ACME::CPANMODULES FEATURE COMPARISON MATRIX
+-------------------------+-----------+-----------+-----------+-----------+-----------+-------+-------+----------------+----------------------+---------------+
| module | create_v1 | create_v2 | create_v3 | create_v4 | create_v5 | is_pp | is_xs | v4_rfc4122 *1) | v4_secure_random *2) | create_legacy |
+-------------------------+-----------+-----------+-----------+-----------+-----------+-------+-------+----------------+----------------------+---------------+
| Data::UUID | yes | yes | no | no | no | no | yes | N/A | N/A | N/A |
| UUID::FFI | yes | no | no | yes | no | no | yes | yes | no | N/A |
| UUID::Tiny | yes | no | yes | yes | yes | yes | no | yes | no | N/A |
| UUID::Random | no | no | no | yes | no | yes | no | no | no | N/A |
| UUID::Random::PERLANCAR | no | no | no | yes | no | yes | no | yes | no | N/A |
| UUID::Random::Secure | no | no | no | yes | no | yes | no | yes | yes | N/A |
| Crypt::Misc | no | no | no | yes | no | yes | no | yes | yes | N/A |
| UUID | no | no | no | no | no | no | yes | no | no | yes |
+-------------------------+-----------+-----------+-----------+-----------+-----------+-------+-------+----------------+----------------------+---------------+
Notes:
=over
=item 1. v4_rfc4122: Whether the generated v4 UUID follows RFC 4122 specification (i.e. encodes variant and version information in M & N positions)
=item 2. v4_secure_random: Whether the module uses cryptographically secure pseudo-random number generator for v4 UUIDs
=back
=head1 BENCHMARKED MODULES
Version numbers shown below are the versions used when running the sample benchmark.
L<Data::UUID> 1.226
L<UUID::FFI> 0.11
lib/Acme/CPANModules_ScenarioR/UUID.pm view on Meta::CPAN
## no critic
package Acme::CPANModules_ScenarioR::UUID;
our $VERSION = 0.011; # VERSION
our $results = [[200,"OK",[{_name=>"participant=UUID::Random::Secure::generate",_succinct_name=>"URS:g",errors=>0.0013,participant=>"UUID::Random::Secure::generate",pct_faster_vs_slowest=>0,pct_slower_vs_fastest=>36.5,rate=>30,samples=>22,time=>30},{...
1;
# ABSTRACT: List of modules that can generate immutable universally unique identifier (UUIDs)
=head1 DESCRIPTION
This module is automatically generated by Pod::Weaver::Plugin::Bencher::Scenario during distribution build.
A Acme::CPANModules_ScenarioR::* module contains the raw result of sample benchmark and might be useful for some stuffs later.
( run in 1.081 second using v1.01-cache-2.11-cpan-39bf76dae61 )