Interface RequestHasher
- All Known Implementing Classes:
Sha256RequestHasher
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy interface for computing a deterministic hash of an HTTP request body.
Implementations must be deterministic and thread-safe. The returned string is stored alongside the idempotency record and compared on every subsequent request with the same key to detect accidental key reuse with a different payload.
The default implementation is Sha256RequestHasher.
-
Method Summary
-
Method Details
-
hash
Computes a hash of the given request body bytes.- Parameters:
requestBody- the raw bytes of the HTTP request body; must not benull.- Returns:
- a non-null, non-empty hex (or otherwise encoded) string representing the hash.
-