[**Documentation**](../../../README)

***

[Documentation](../../../README) / [@zerotal/auth](../README) / Hash

# Variable: Hash

> `const` **Hash**: [`HashService`](../classes/HashService)

Defined in: [auth/src/facades/Hash.ts:26](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/auth/src/facades/Hash.ts#L26)

The `Hash` facade — password hashing, backed by [HashService](../classes/HashService) (native
`Bun.password`).

## Remarks

Resolves the `hash` binding from the container, so it is usable only after
`app.boot()`. The service uses **argon2id** by default (stronger than bcrypt
for new projects); the algorithm marker is embedded in the returned hash, so
[check](../classes/HashService#check) and [needsRehash](../classes/HashService#needsrehash)
need no configuration to verify existing hashes. [Auth.attempt](Auth#attempt) calls
`needsRehash` and transparently upgrades stored hashes on login.

Available methods: `make(password)`, `check(password, hash)`,
`needsRehash(hash)`, `selfTest()` — see [HashService](../classes/HashService).

## Example

```ts
import { Hash } from '@zerotal/auth';

const hash  = await Hash.make('secret123');   // argon2id hash to persist
const valid = await Hash.check('secret123', hash); // true
```
