line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::IdGenerator::UUID; |
2
|
|
|
|
|
|
|
|
3
|
21
|
|
|
21
|
|
115730
|
use Catmandu::Sane; |
|
21
|
|
|
|
|
53
|
|
|
21
|
|
|
|
|
138
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
6
|
|
|
|
|
|
|
|
7
|
21
|
|
|
21
|
|
11869
|
use UUID::Tiny qw(:std); |
|
21
|
|
|
|
|
263922
|
|
|
21
|
|
|
|
|
4203
|
|
8
|
21
|
|
|
21
|
|
185
|
use Moo; |
|
21
|
|
|
|
|
59
|
|
|
21
|
|
|
|
|
171
|
|
9
|
21
|
|
|
21
|
|
8606
|
use namespace::clean; |
|
21
|
|
|
|
|
55
|
|
|
21
|
|
|
|
|
190
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
with 'Catmandu::IdGenerator'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub generate { |
14
|
108
|
|
|
108
|
0
|
12823
|
create_uuid_as_string(UUID_V1); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
1; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
__END__ |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=pod |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 NAME |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Catmandu::IdGenerator::UUID - Generator of UUID identifiers |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 SYNOPSIS |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
use Catmandu::IdGenerator::UUID; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $x = Catmandu::IdGenerator::UUID->new; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
for (1..100) { |
34
|
|
|
|
|
|
|
printf "id: %s\n" , $x->generate; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 DESCRIPTION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
This L<Catmandu::IdGenerator> generates identifiers based on the Universally |
40
|
|
|
|
|
|
|
Unique Identifier (UUID) v1 standard. A UUID string is a 128 bit number |
41
|
|
|
|
|
|
|
represented by lowercase hexadecimal digits such as |
42
|
|
|
|
|
|
|
C<de305d54-75b4-431b-adb2-eb6b9e546014>. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |