# # make sure v1 mac is hidden and same. # use strict; use warnings; use MyTest; use vars qw(@OPTS); BEGIN { @OPTS = qw(:mac=random); ok 1, 'began'; } use UUID @OPTS; ok 1, 'loaded'; my $uu = UUID::uuid1(); ok 1, 'got something'; note $uu; # 2d2281bc-b455-11ee-8325-5526d7fe9526 is substr($uu, 14, 1), '1', 'its v1'; is substr(unpack("B*", pack("H*", substr($uu, 19, 2))), 0, 2), '10', 'its dce'; is substr(unpack("B*", pack("H*", substr($uu, 24, 2))), 7, 1), '1', 'mcast set'; # all same. for (1..9) { my $ut = UUID::uuid1(); my $n1 = substr $uu, 24; my $n2 = substr $ut, 24; is $n2, $n1, "same $_"; } done_testing;