Determine the ASCII code for the current character of the string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | s |
pure elemental integer(ip) function hash(s) !! Determine the ASCII code for the current character of the string. character(len=*),intent(in) :: s integer :: i hash = 0 do i = 1, len(s) hash = modulo(17_ip*( hash + iachar(s(i:i))), 256_ip) end do end function hash