1 2 3 4 5 6
sub get_new_confirm_number{ my @numbers; foreach(0..14){ $numbers[$_] = int(rand(10)); } my $regnummer = join("", @numbers); return $regnummer; }
1 2 3 4 5
use Digest::SHA1 qw(sha1_hex); use Time::HiRes qw(gettimeofday); my ($seconds, $microseconds) = gettimeofday; my $t = $seconds * 1_000_000 + $microseconds; my $UID = sha1_hex($mail) . '-' . sha1_hex($username) . '-' . sha1_hex($t);