Feed the nbytes low-order bytes of value, least significant first.
ibits yields the unsigned value of each byte of the two’s-complement
representation, so the stream is independent of host endianness.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(inout) | :: | state | |||
| integer(kind=int64), | intent(in) | :: | value |
Value to encode, already widened to |
||
| integer(kind=default_int), | intent(in) | :: | nbytes |
How many low-order bytes of |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=default_int), | private | :: | i |
pure subroutine feed_integer(state, value, nbytes) !! Feed the `nbytes` low-order bytes of `value`, least significant first. !! !! `ibits` yields the unsigned value of each byte of the two's-complement !! representation, so the stream is independent of host endianness. integer(int32), intent(inout) :: state integer(int64), intent(in) :: value !! Value to encode, already widened to `int64` by the caller. integer(default_int), intent(in) :: nbytes !! How many low-order bytes of `value` are significant, 1 to 8. integer(default_int) :: i do i = 0_default_int, nbytes - 1_default_int call fnv1a_byte(state, ibits(value, 8_default_int*i, 8_default_int)) end do end subroutine feed_integer