DJB hash algorithm for a real(wp)
vector.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | r |
the vector |
the hash value
pure function vector_djb_hash(r) result(hash) real(wp),dimension(:),intent(in) :: r !! the vector integer(ip) :: hash !! the hash value integer :: i !! counter hash = 5381_ip do i=1,size(r) hash = ishft(hash,5_ip) + hash + transfer(r(i),1_ip) end do end function vector_djb_hash