# Hasher

`import { Hasher } from "destack:ops";`

A stateful hash sink.

```ds title="Hasher"
export newtype interface Hasher {
    write(bytes: &'a readonly [uint8]): void;
    writeUint8(value: uint8): void;
    writeUsize(value: usize): void;
    finish(): uint64;
}
```

[language/library/src/ops/hash.ds:3:15](https://github.com/destack-sh/destack/blob/main/language/library/src/ops/hash.ds#L3-L15)

## Members

### `write(bytes: &'a readonly [uint8]): void`

Add raw bytes to the hash state.

### `writeUint8(value: uint8): void`

Add one unsigned byte to the hash state.

### `writeUsize(value: usize): void`

Add one unsigned machine word to the hash state.

### `finish(): uint64`

Finish the hash state.
