Format a digest as 8 lowercase hexadecimal characters.
Built from ibits and a lookup table rather than a Z edit
descriptor, so the result is identical on every compiler and no
internal I/O is involved.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | hash_value |
Digest to format, typically from |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=default_int), | private | :: | i | ||||
| integer(kind=default_int), | private | :: | nibble |
pure function array_hash_hex(hash_value) result(text) !! Format a digest as 8 lowercase hexadecimal characters. !! !! Built from `ibits` and a lookup table rather than a `Z` edit !! descriptor, so the result is identical on every compiler and no !! internal I/O is involved. integer(int32), intent(in) :: hash_value !! Digest to format, typically from `digest` or `array_hash`. character(len=8) :: text integer(default_int) :: i, nibble do i = 1_default_int, 8_default_int nibble = int(ibits(hash_value, 4_default_int*(8_default_int - i), & 4_default_int), default_int) text(i:i) = HEX_DIGITS(nibble + 1_default_int:nibble + 1_default_int) end do end function array_hash_hex