Class HasherImpl

java.lang.Object
com.example.blogs.app.security.HasherImpl
All Implemented Interfaces:
Hasher

@Component public class HasherImpl extends Object implements Hasher
Hashes strings using SHA-256 algorithm and returns hexadecimal representation.
  • Constructor Details

    • HasherImpl

      public HasherImpl()
  • Method Details

    • hash

      public String hash(String input)
      Hashes the input string using SHA-256 and returns hex-encoded result.
      Specified by:
      hash in interface Hasher
      Parameters:
      input - the string to hash
      Returns:
      hexadecimal representation of the hash
      Throws:
      IllegalStateException - if hashing operation fails