#!/usr/bin/perl use Time::HiRes qw /time/; use Crypt::Blowfish; $unique = &ecry(time); # the_line print "Unique ID: $unique\n"; sub ecry() { my ($e_msg, $m); my $msg = shift; my $block; my $cipher = new Crypt::Blowfish pack("H32", "0123456789abcdef"); $msg = time . "$msg"; while($msg =~ m/(.{1,8})/g) { $m = $1; $m = $m . " " while length($m) < 8; $block = $cipher->encrypt($m); $e_msg = $e_msg . $block; } return unpack("H*", $e_msg); }
update: tilly suggests using some combination of time and Math::TrulyRandom on the_line (above).
In reply to Re: Randomizing Unique ID?
by jettero
in thread Randomizing Unique ID?
by Martin A
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |