Automattic\WooCommerce\Internal\Admin\Logging\FileV2
File::generate_hash
Generate a hash to use as the suffix on a log filename.
Method of the class: File{}
No Hooks.
Returns
String.
Usage
$result = File::generate_hash( $file_id ): string;
- $file_id(string) (required)
- A file ID (file basename without the hash).
File::generate_hash() File::generate hash code WC 10.3.5
public static function generate_hash( string $file_id ): string {
$key = Constants::get_constant( 'AUTH_SALT' ) ?? 'wc-logs';
return hash_hmac( 'md5', $file_id, $key );
}