use Digest::MD5 qw(md5_hex); my $ndv = md5_hex('53cr3t 57r1n6'.$$.rand().localtime() ); my $smallndv = substr($ndv, 0, 4);