Interface TokenGenerator


public interface TokenGenerator
Port that creates random opaque tokens and hashes them for storage.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates an unguessable URL-safe token.
    hash(String token)
    Hashes a token with a deterministic, one-way function, so a stored hash can be looked up by the presented token.
  • Method Details

    • generate

      String generate()
      Creates an unguessable URL-safe token.
      Returns:
      the token.
    • hash

      String hash(String token)
      Hashes a token with a deterministic, one-way function, so a stored hash can be looked up by the presented token.
      Parameters:
      token - the token value.
      Returns:
      the hash.