What's New in Hash Calculator 2 v2.4
Calculate integrety property for link and script tag in HTML
As security is more and more important for web development, while we reference a third-party javascript or css from JS CDN, we must make sure it is not hijacked during transfer. HTML 5 brings integrity
property for link
and script
tag, to prevent MITM attack to JS CDN. Many JS CDN added integrity
property for link
and script
by default, like this code snippet from CloudFlare JS CDN:
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
But some JS CDNs are not have integrity
property by default, so we must add it manually to secure our web apps. How can we calculate the integrity
property by ourselves?
The latest version of Hash Calculator 2 brings this new feature, targeting to solve this problem.
- Launch app, select any JS or CSS file.
- Check “SHA 384” in algorithm section。
- Click “Calculate” button.
- By press and release Option key, you switch between Hex representation and Base64 representation of file hash.
- Press and hold Option key, double click the “SHA 384” line, the result like following will be copied to pasteboard:
SHA384 uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm
Replace SHA384
by sha384-
, you could get the integrity
value for the file:
sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm
If you have used our Finder integration, you can get the value without open our app:
- Choose a JS or CSS file in Finder.
- Click the “Share” button on toolbar select “Calculate Hash”.
- In result window, check “SHA 384” and click “Calculate”.
- Press and hold Option key and double click to copy the hash result.
Isn’t that easy?
We hope you enjoy using our Finder integration and the new feature in this update.