Automattic\WooCommerce\Internal\StockNotifications\Utilities
HasherHelper::wp_fast_hash
Hash a string.
Method of the class: HasherHelper{}
No Hooks.
Returns
String. The hashed string.
Usage
$result = HasherHelper::wp_fast_hash( $key ): string;
- $key(string) (required)
- The string to hash.
HasherHelper::wp_fast_hash() HasherHelper::wp fast hash code WC 10.3.6
public static function wp_fast_hash( string $key ): string {
if ( function_exists( 'wp_fast_hash' ) ) {
return wp_fast_hash( $key );
}
$hashed = sodium_crypto_generichash( $key, 'wp_fast_hash_6.8+', 30 );
return '$generic$' . sodium_bin2base64( $hashed, SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING );
}