MT#61074 Unify UUID generation to libuuid-perl new API

Instead of using two different modules to generate UUIDs and GUIDs, use
a single implementation, which we use uniformly in all of our codebase,
so that we can drop this from our dependency tree.

Switch to use the new API, which simplifies the code.

Change-Id: I37013c063f283cd27b8ffc48129b35288ce733a5
mr13.0
Guillem Jover 7 months ago
parent cba4695e57
commit 24a0a76c1e

@ -34,7 +34,6 @@ my $builder = Module::Build->new(
'DBI' => '1.608',
'Data::Dump' => 0,
'Data::Rmap' => 0,
'Data::UUID' => 0,
'Data::Validate::IP' => 0,
'Date::Calc' => 0,
'Date::Manip' => 0,

2
debian/control vendored

@ -5,7 +5,6 @@ Maintainer: Sipwise Development Team <support@sipwise.com>
Rules-Requires-Root: binary-targets
Build-Depends:
debhelper-compat (= 13),
libdata-uuid-perl <!nocheck>,
libdata-validate-ip-perl <!nocheck>,
libdate-calc-perl <!nocheck>,
libdate-manip-perl <!nocheck>,
@ -23,7 +22,6 @@ Depends:
libconfig-any-perl,
libdata-dump-perl,
libdata-rmap-perl,
libdata-uuid-perl,
libdata-validate-ip-perl,
libdate-calc-perl,
libdate-manip-perl,

@ -11,7 +11,6 @@ setlocale(LC_NUMERIC, 'C');
use List::Util qw(max min);
use Data::UUID qw();
use UUID qw();
use Data::Validate::IP qw(is_ipv4 is_ipv6);
@ -404,18 +403,11 @@ sub wrap_text {
}
sub create_guid {
my $ug = Data::UUID->new();
my $uuid = $ug->create();
return $ug->to_string( $uuid );
return uc UUID::uuid();
}
sub create_uuid {
my ($bin, $str);
UUID::generate($bin);
UUID::unparse($bin, $str);
return $str;
return UUID::uuid();
}
sub urlencode {

Loading…
Cancel
Save