Repository navigation
cspHash
Aidan Woods edited this page Jul 16, 2017
·
2 revisions
string cspHash (
string $friendlyDirective
, string $string
[, ?string $algo = 'sha256'
[, mixed $isFile = null
[, mixed $reportOnly = null ] ] ]
)Generate a hash of the provided $string value, and have it
added to the $friendlyDirective directive in CSP.
The (case insensitive) friendly name that the hash should be to be added to.
The string that should be hashed and added to the
$friendlyDirective
directive.
The hashing algorithm to use. CSP currently supports sha256,
sha384, sha512.
Loosely casted as a boolean. Indicates that $string instead
specifies a file path.
Loosely casted as a boolean. Indicates that the hash should be added
to the report only policy true, or the enforced policy false.
Returns the hash value.