Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

File Hash

3,194 sites Security covered Drupal 11 · not 10
View on drupal.org

This module generates and stores checksums (hashes) for uploaded files, allowing for unique identification, duplicate detection, and verification. It supports various hashing algorithms and makes these hashes available for use in themes, Views, and other modules, with an optional feature to prevent duplicate file uploads.

Hashes of uploaded files, which can be found on a variety of sites from archive.org to wikileaks.org, allow files to be uniquely identified, duplicate files to be detected, and copies to be verified against the original source.

File Hash module generates and stores BLAKE2b-128, BLAKE2b-160, BLAKE2b-224, BLAKE2b-256, BLAKE2b-384, BLAKE2b-512, MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512/224, SHA-512/256, SHA-512, SHA3-224, SHA3-256, SHA3-384 and/or SHA3-512 hashes for each file uploaded to the site (note that usage of the BLAKE2b hash algorithm requires the Sodium PHP extension or paragonie/sodium_compat polyfill).

Hash algorithms can be enabled and disabled by the site administrator.

Hash values are loaded into the File object (as fields in the 2.x and 3.x branches) where they are available to the theme, Views and other modules.

Tokens are provided for the full hashes, as well as pairtree tokens useful for content-addressable storage. For example, if the SHA-512/256 hash for a file is 3998b02c5cd27231..., you could store it in the files/39/98 directory using these tokens: [file:filehash-sha512_256-pair-1]/[file:filehash-sha512_256-pair-2]. Note, to use these tokens to configure the file upload directory, File (Field) Paths module is required.

Optional duplicate file prevention

A checkbox in File Hash settings—as well as in the field settings for each file field—allows duplicate uploaded files to be rejected (for all file fields, or for specific file fields, respectively). This feature should be considered a proof-of-concept—you may want better UX for such a feature. Note, if you use a module that allows existing file entities to be updated with a new file, the duplicate check will not be performed on the contents of the updated file (please file a feature request if this issue affects you). In Drupal 7, empty files are not considered duplicate files, as such "files" may represent remote media assets, etc.

You can support development by contributing or sponsoring.

Ports:

This project has been ported to Backdrop CMS.

Depends on

Dependencies of the latest stable release

  • file Drupal core

Required by

2 tracked projects depend on this one

Activity

Tracked releases
16
Tracked since
Sep 2025
Latest release
4 days ago
Releases (12 mo)
16 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
4.0.1 Stable 11 Aug 28, 2026
4.0.0 Stable 11 Aug 26, 2026
4.x-dev Dev 11 Aug 26, 2026
3.3.1 Stable 10–11 Aug 25, 2026
2.1.2 Stable 8–10 Aug 25, 2026
8.x-1.13 Stable 8–10 Aug 25, 2026
3.3.0 Stable 10–11 Aug 17, 2026
3.2.3 Stable 10–11 Jan 16, 2026
2.1.1 Stable 8–10 Sep 28, 2025
3.2.2 Stable 10–11 Sep 28, 2025
3.2.1 Stable 10–11 Sep 27, 2025
8.x-1.12 Stable 8–10 Sep 27, 2025
2.1.0 Stable 8–10 Sep 27, 2025
3.2.0 Stable 10–11 Sep 27, 2025
3.1.0 Stable 10–11 Sep 19, 2025
3.0.6 Stable 10–11 Sep 16, 2025