Reset a 32-bit hash accumulator and fold in a container’s identity.
Feeds the schema string and then the element count as an explicit
int64, so the digest is the same in a default build and in a
PIC_DEFAULT_INT8 build. Folding the schema first means two
containers with different field lists cannot produce the same digest
even when their numeric payloads agree, and folding the count means an
empty container is distinguishable from an absent one.
The caller then folds in every field’s live slice, in declaration
order, and takes hasher%digest().
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(array_hash_t), | intent(inout) | :: | hasher |
Accumulator to restart. |
||
| character(len=*), | intent(in) | :: | schema |
The container’s schema string. |
||
| integer(kind=default_int), | intent(in) | :: | n |
Number of live elements. |
subroutine soa_hash_begin_32(hasher, schema, n) !! Reset a 32-bit hash accumulator and fold in a container's identity. !! !! Feeds the schema string and then the element count as an explicit !! `int64`, so the digest is the same in a default build and in a !! `PIC_DEFAULT_INT8` build. Folding the schema first means two !! containers with different field lists cannot produce the same digest !! even when their numeric payloads agree, and folding the count means an !! empty container is distinguishable from an absent one. !! !! The caller then folds in every field's live slice, in declaration !! order, and takes `hasher%digest()`. type(array_hash_t), intent(inout) :: hasher !! Accumulator to restart. character(len=*), intent(in) :: schema !! The container's schema string. integer(default_int), intent(in) :: n !! Number of live elements. call hasher%reset() call hasher%update(schema) call hasher%update(int(n, int64)) end subroutine soa_hash_begin_32