Record Class ResourceEstimate
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.password.provider.ResourceEstimate
- Record Components:
estimatedCpuTimeMicros- approximate wall time the verification will spend in the KDFestimatedMemoryBytes- approximate peak memory the KDF holds at once
public record ResourceEstimate(long estimatedCpuTimeMicros, long estimatedMemoryBytes)
extends Record
Coarse resource estimate produced by a
PasswordHashProvider
for a given parameter set.
Phase-1a providers may return zeros; the type becomes meaningful with the Phase-1b memory-hard algorithms (Argon2id, scrypt) where the KDF execution limiter uses the estimate to enforce a process-wide resource budget (CWE-400).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionResourceEstimate(long estimatedCpuTimeMicros, long estimatedMemoryBytes) Creates an instance of aResourceEstimaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longReturns the value of theestimatedCpuTimeMicrosrecord component.longReturns the value of theestimatedMemoryBytesrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
UNKNOWN
-
-
Constructor Details
-
ResourceEstimate
public ResourceEstimate(long estimatedCpuTimeMicros, long estimatedMemoryBytes) Creates an instance of aResourceEstimaterecord class.- Parameters:
estimatedCpuTimeMicros- the value for theestimatedCpuTimeMicrosrecord componentestimatedMemoryBytes- the value for theestimatedMemoryBytesrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
estimatedCpuTimeMicros
public long estimatedCpuTimeMicros()Returns the value of theestimatedCpuTimeMicrosrecord component.- Returns:
- the value of the
estimatedCpuTimeMicrosrecord component
-
estimatedMemoryBytes
public long estimatedMemoryBytes()Returns the value of theestimatedMemoryBytesrecord component.- Returns:
- the value of the
estimatedMemoryBytesrecord component
-