hash Function

private pure function hash(s) result(h)

FNV-1a hash.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: s

the bytes to hash

Return Value integer(kind=int64)


Called by

proc~~hash~~CalledByGraph proc~hash hash proc~line_ids line_ids proc~line_ids->proc~hash proc~unified_diff unified_diff proc~unified_diff->proc~line_ids proc~process_text process_text proc~process_text->proc~unified_diff proc~process_file process_file proc~process_file->proc~process_text proc~process_stdin process_stdin proc~process_stdin->proc~process_text proc~run run proc~run->proc~process_file proc~run->proc~process_stdin

Source Code

pure integer(int64) function hash(s) result(h)
    !! FNV-1a hash.
    character(len=*), intent(in) :: s   !! the bytes to hash
    integer :: k
    h = 1469598103_int64
    do k = 1, len(s)
        h = ieor(h, int(iachar(s(k:k)), int64))
        h = h*16777619_int64
        h = iand(h, 4294967295_int64)
    end do
end function hash