amp_generate_script_hash

amp_generate_script_hash( string $script )

Description #

Generate hash for inline amp-script.

The sha384 hash used by amp-script is represented not as hexadecimal but as base64url, which is defined in RFC 4648 under section 5, "Base 64 Encoding with URL and Filename Safe Alphabet". It is sometimes referred to as "web safe".


Parameters #

$script

(string) (Required) Script.


Return #

(string|null) Script hash or null if the sha384 algorithm is not supported.


Changelog #

Changelog
Version Description
1.4.0 Introduced.