- or download this
use List::Util qw( sum );
my $id = (sum map ord, map /./sg, $word) % 65536;
- or download this
my $id = 0;
foreach (map ord, map /./sg, $word) {
$id = ($id + $_) % 65536;
}
- or download this
use Digest::MD5 qw( md5 );
my $id = unpack('n', substr(md5($word), -2));