RELEASE=2.0
VERSION=1.0
-PKGREL=5
+PKGREL=6
PACKAGE=libpve-common-perl
use base 'Exporter';
use URI::Escape;
use Encode;
+use Digest::SHA1;
our @EXPORT_OK = qw(
lock_file
return Encode::decode("utf8", uri_unescape($data));
}
+sub random_ether_addr {
+
+ my $rand = Digest::SHA1::sha1_hex(rand(), time());
+
+ my $mac = '';
+ for (my $i = 0; $i < 6; $i++) {
+ my $ss = hex(substr($rand, $i*2, 2));
+ if (!$i) {
+ $ss &= 0xfe; # clear multicast
+ $ss |= 2; # set local id
+ }
+ $ss = sprintf("%02X", $ss);
+
+ if (!$i) {
+ $mac .= "$ss";
+ } else {
+ $mac .= ":$ss";
+ }
+ }
+
+ return $mac;
+}
1;
+libpve-common-perl (1.0-6) unstable; urgency=low
+
+ * add PVE::Tools::random_ether_addr()
+
+ -- Proxmox Support Team <support@proxmox.com> Wed, 05 Oct 2011 09:19:39 +0200
+
libpve-common-perl (1.0-5) unstable; urgency=low
* cleanups (prepare for beta release)
Package: libpve-common-perl
Architecture: all
-Depends: ${perl:Depends} ${misc:Depends}, libdevel-cycle-perl, libwww-perl, libjson-perl, liblinux-inotify2-perl, libio-stringy-perl, liburi-perl
+Depends: ${perl:Depends} ${misc:Depends}, libdevel-cycle-perl, libwww-perl, libjson-perl, liblinux-inotify2-perl, libio-stringy-perl, liburi-perl, libdigest-sha1-perl
Description: Proxmox VE base library
This package contains the base library used by other Proxmox VE components.