Help for this page

Select Code to Download


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