Skip to main content

## evaluate

# Function evaluate

Source

    pub fn evaluate(
        state: &PinState,
        now: DateTime<Utc>,
        pin_matches: bool,
    ) -> (PinDecision, PinState)

Expand description

Decide an attempt and produce the state to persist.

`pin_matches` is the result of the hash comparison; passing it in rather than doing the comparison here is what keeps this function pure and cheap to test across the whole attempt/lockout space.

A locked profile is refused without consulting the hash, so a caller cannot burn through a lockout by guessing quickly.

TRACES: UR-083 | DR-268