Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Filename Hash Token

Security covered Under active development 35 sites

This module provides tokens that generate a hash from a filename. It also offers a token for a specific substring of that hash, which can be used with path-handling modules to organize uploaded files.

Introduction

The Filename Hash Token module defines tokens for a hash and a substring of a hash, generated from a filename. The substring token is especially useful when used with the File (Field) Paths module to organize files within a site's public files directory.

Dependencies

This module depends on the File module provided by Drupal core. The File (Field) Paths module can be leveraged to define directory paths using a hash substring generated by the name of an uploaded file. The Token module is helpful to provide a UI for browsing tokens.

Configuration

This module requires no configuration.

Examples of use

All examples use the filename "Example_File.txt".

Token: [file:name-hash]
Result: 2923b18d012d783db62a172af46da20f (The full hash of the filename)

Token: [file:name-hash-substring:4]
Result: 2923 (4 characters from the hash, offset by 0 characters)

Token: [file:name-hash-substring:2,3]
Result: 3b (2 characters from the hash, offset by 3 characters)

Maintainer

Current maintainer:

Drupal 8–11

Ask your assistant about Filename Hash Token

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • file Drupal core >= 8.8.0

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Jan 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Active

Releases

Version Type Core PHP Release date
1.0.1 Stable 8–11 Jan 30, 2025
1.0.0 Stable 8–10 Jan 23, 2023