Image by Pexels from Pixabay

Content Security Policy (CSP) Generate Hash for Internal Scripts & Styles

CSP Hash via PowerShell

https://gist.github.com/phbits/ee9da83c7d826ecef4faad8e459d7485
$Style = "html, body { height: 100%; font-family: 'Courier'; }"
Get-CspSha256Hash $Style

CSP Hash via Console

Refused to apply inline style because it violates the following Content Security  Policy directive: "style-src 'self' 'sha256-AAAAAAAA...'". Either the  'unsafe-inline' keyword, a hash ('sha256-BBBBBBBB...'), or a nonce  ('nonce=...') is required to enable inline execution.

 by the author.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store