---
title: "hash · RUAL Documentation"
description: "Computes a content hash (sha256 by default; md5/sha1 supported) for each given file : e.g. to detect duplicate uploads before storing them."
canonical: https://docs.rual.nl/block-types/files/file_hash
language: en
---

# hash

This block is part of the [`files`](https://docs.rual.nl/block-types/files) group and was last modified in core [`v15.0.0`](https://docs.rual.nl/core-versions/150000).

Computes a content hash (sha256 by default; md5/sha1 supported) for each given file : e.g. to detect duplicate uploads before storing them.

- flow `flow`

- files required `file`

- algorithm `value` Hash algorithm: sha256 (default), sha1 or md5

Default `sha256`

- flow `flow`

- success `condition`

- error `value`

- files `file` The input files, each with a `hash` field added

- hash `value` The first file's hex digest : the common single-upload case

A typical wiring for [hash](https://docs.rual.nl/block-types/files/file_hash): [branch](https://docs.rual.nl/block-types/flow/branch) feeds the `flow` pin; [get file from assets](https://docs.rual.nl/block-types/files/file_from_assets) feeds the `file` pin; the `flow` out pin feeds [create document](https://docs.rual.nl/block-types/storage/function_create_document_from_mutations).

![Studio canvas example for the hash block: typical wiring for hash.](https://docs.rual.nl/canvas-examples/file_hash.png)

### Commonly used with

In production blueprints, this block is most often wired together with:

- [branch](https://docs.rual.nl/block-types/flow/branch): feeds into this block.

- [create document](https://docs.rual.nl/block-types/storage/function_create_document_from_mutations): this block feeds into it. Creates a document in the given storage.

- [set fields](https://docs.rual.nl/block-types/mutations/mutations_set_bp_field_multiple): this block feeds into it. Generates an array of mutations based on the given filled fields.

### Version history

Introduced in [`v15.0.0`](https://docs.rual.nl/core-versions/150000).
