Interface OneTimeCodeHasher


public interface OneTimeCodeHasher
Port that hashes one-time codes so that only the hash is stored.
  • Method Summary

    Modifier and Type
    Method
    Description
    hash(String code)
    Hashes a code.
    boolean
    matches(String code, String hash)
    Tells whether a code matches a hash, comparing in constant time.
  • Method Details

    • hash

      String hash(String code)
      Hashes a code.
      Parameters:
      code - the code.
      Returns:
      the hash.
    • matches

      boolean matches(String code, String hash)
      Tells whether a code matches a hash, comparing in constant time.
      Parameters:
      code - the submitted code.
      hash - the stored hash.
      Returns:
      true when the code produces the hash.