csp_hasher library
Support for doing something awesome.
More dartdocs go here.
Classes
Enums
- HashMode
- HashMode is used to determine whether to hash script or style tags in the given HTMl
Constants
Functions
-
hashScripts(
{required File htmlFile, Hash hashType = sha256, HashMode hashMode = HashMode.script}) → List< CspHash> -
Hashes all the scripts in the html file
Returns a list of CspHash
If there are no scripts, it returns an empty list
hashType
is the type of hash to use (sha256, sha384, sha512), defaults to sha256hashMode
is the mode to use (script, style), defaults to scripthtmlFile
is the html file to hash Ignores scripts with a nonce attribute