Class Sha256RequestHasher

java.lang.Object
io.github.ravocode.avoonce.core.hash.Sha256RequestHasher
All Implemented Interfaces:
RequestHasher

public class Sha256RequestHasher extends Object implements RequestHasher
Default RequestHasher that produces a lowercase hex-encoded SHA-256 digest.

SHA-256 is collision-resistant and widely available on all JVM distributions via MessageDigest, requiring no additional dependencies.

This class is stateless and thread-safe; the same instance may be shared across the application.

  • Constructor Details

    • Sha256RequestHasher

      public Sha256RequestHasher()
  • Method Details

    • hash

      public String hash(byte[] requestBody)
      Computes a SHA-256 hash of the supplied request body.
      Specified by:
      hash in interface RequestHasher
      Parameters:
      requestBody - the raw request body bytes
      Returns:
      the lowercase hex-encoded hash string