array_hash64_reset Subroutine

private pure subroutine array_hash64_reset(this, seed)

Return the accumulator to its initial state.

With no argument it restarts from ARRAY_HASH64_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_hash64_t

Arguments

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

Starting hash value; defaults to ARRAY_HASH64_OFFSET_BASIS.


Called by

proc~~array_hash64_reset~~CalledByGraph proc~array_hash64_reset array_hash64_t%array_hash64_reset proc~soa_hash_begin_64 soa_hash_begin_64 proc~soa_hash_begin_64->proc~array_hash64_reset interface~soa_hash_begin soa_hash_begin interface~soa_hash_begin->proc~soa_hash_begin_64 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_hash64_reset(this, seed)
      !! Return the accumulator to its initial state.
      !!
      !! With no argument it restarts from `ARRAY_HASH64_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_hash64_t), intent(inout) :: this
      integer(int64), intent(in), optional :: seed
         !! Starting hash value; defaults to `ARRAY_HASH64_OFFSET_BASIS`.

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