| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | str |
String to hash |
Returned hash
pure function hashtbl_obj_HashString(str) result(val) ! Computes and returns a hash (integer) from a string. implicit none character(len=*), intent(in) :: str !! String to hash integer :: val !! Returned hash ! Work variable integer :: i val = 0 do i=1,len_trim(str) val = mod(val*31 + ichar(str(i:i)),35386740) end do return end function hashtbl_obj_HashString