---
title: Construct a de-salting SaltShaker
summary: Build a SaltShaker instance with no date-part state, usable only to de-salt a previously salted hash.
status: draft
owner: SAIF Platform Team
last_reviewed: 2026-10-02
library: SAIF.NetCore.HashUtil
reference_type: package
operation_id: OP-HU-02
trigger: Caller needs to de-salt a hash
---

# Construct a de-salting SaltShaker

This operation builds a `SaltShaker` instance using the parameterless constructor, which leaves `_dateParts` as `null` and is only safe to use for `BlandHash` (OP-HU-04), never `SaltHash`. In-repo, `SystemHashService.RemoveSystemHashSaltAndValidateLifetime` is the sole caller.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-HU-02 |
| **Trigger** | Caller needs to de-salt a hash (in-repo: `SystemHashService.RemoveSystemHashSaltAndValidateLifetime`) |
| **Inputs** | none |
| **Outputs** | `SaltShaker` instance with `_random` populated; `_dateParts` left `null` |
| **Primary components** | `SaltShaker.SaltShaker()` |
| **Entry point** | `src/SAIF.NetCore.HashUtil/SAIF.NetCore.HashUtil/SaltShaker.cs` |

## Steps

1. Create a new `System.Random` instance ([BR-HU-04](../business-rules.md#br-hu-04-constructor-split-between-salting-and-de-salting) — this instance is unusable for `SaltHash` because `_dateParts` is never populated).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Caller needs to de-salt a hash]) --> S1["Create System.Random;<br>_dateParts left null"]
	S1 --> EndOk([Instance ready for BlandHash only])
```

## Failure and edge-case behavior
- The resulting instance has a `null` `_dateParts`; calling `SaltHash` on it throws an unguarded `NullReferenceException` because `SaltHash` iterates `_dateParts` directly ([BR-HU-04](../business-rules.md#br-hu-04-constructor-split-between-salting-and-de-salting)).

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

## Sources
- `src/SAIF.NetCore.HashUtil/SAIF.NetCore.HashUtil/SaltShaker.cs`
- `src/SAIF.NetCore.SystemHash/SAIF.NetCore.SystemHash/SAIF.NetCore.SystemHash/SystemHashService.cs`
