| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Boost::UUID; |
|
2
|
1
|
|
|
1
|
|
60694
|
use 5.020; |
|
|
1
|
|
|
|
|
3
|
|
|
3
|
1
|
|
|
1
|
|
4
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
17
|
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
21
|
|
|
5
|
1
|
|
|
1
|
|
4
|
use XSLoader; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
49
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Boost::UUID |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=cut |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
|
14
|
|
|
|
|
|
|
XSLoader::load( 'Boost::UUID', $VERSION ); |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 SYNOPSYS |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Simple Perl interface for boost::uuid_generators ( look here [boost::uuid doc] L ) |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head3 Random UUID generator |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Genarate unique SHA-1 hash every time. |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Work with B |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
C< my $uuid = Boost::UUID::random_uuid(); > |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Result: B<01234567-89ab-cdef-0123-456789abcdef> |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head3 Nil UUID generator |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Generate nil UUID |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Work with B |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
C |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Result: B<00000000-0000-0000-0000-000000000000> |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head3 String UUID |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Convert string UUID to boost UUID ( better check out [doc] L ) |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Work with B, but return nill UUID in wrong input string case |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
C< Boost::UUID::string_uuid("0123456789abcdef0123456789abcdef") > |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Result: B<01234567-89ab-cdef-0123-456789abcdef> |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head3 Name UUID generator |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Generate SHA hash from any string. |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Work with B |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
C< Boost::UUID::name_uuid("crazypanda.ru"); > |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Result: B<25f9de77-a9a6-5816-b7cb-bafc0a203417> |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 AUTHOR |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Vladimir Melnichenko , Crazy Panda, CP Decision LTD |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
L |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 LICENSE |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
You may distribute this code under the same terms as Boost itself. |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=cut |