array_hash_reset Subroutine

private pure subroutine array_hash_reset(this, seed)

Return the accumulator to its initial state.

With no argument it restarts from ARRAY_HASH_OFFSET_BASIS. Pass seed to start from a different value instead, which is how you domain-separate two hashes over the same bytes, or resume a digest saved by an earlier run.

Type Bound

array_hash_t

Arguments

Type IntentOptional Attributes Name
class(array_hash_t), intent(inout) :: this
integer(kind=int32), intent(in), optional :: seed

Starting hash value; defaults to ARRAY_HASH_OFFSET_BASIS.


Called by

proc~~array_hash_reset~~CalledByGraph proc~array_hash_reset array_hash_t%array_hash_reset proc~soa_hash_begin_32 soa_hash_begin_32 proc~soa_hash_begin_32->proc~array_hash_reset interface~soa_hash_begin soa_hash_begin interface~soa_hash_begin->proc~soa_hash_begin_32 proc~particle_soa_state_hash particle_soa_t%particle_soa_state_hash proc~particle_soa_state_hash->interface~soa_hash_begin proc~particle_soa_state_hash64 particle_soa_t%particle_soa_state_hash64 proc~particle_soa_state_hash64->interface~soa_hash_begin

Source Code

   pure subroutine array_hash_reset(this, seed)
      !! Return the accumulator to its initial state.
      !!
      !! With no argument it restarts from `ARRAY_HASH_OFFSET_BASIS`. Pass
      !! `seed` to start from a different value instead, which is how you
      !! domain-separate two hashes over the same bytes, or resume a digest
      !! saved by an earlier run.
      class(array_hash_t), intent(inout) :: this
      integer(int32), intent(in), optional :: seed
         !! Starting hash value; defaults to `ARRAY_HASH_OFFSET_BASIS`.

      if (present(seed)) then
         this%state = seed
      else
         this%state = ARRAY_HASH_OFFSET_BASIS
      end if
      this%nbytes = 0_int64
   end subroutine array_hash_reset