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.

Hash Calculator 2, base64 encoded file hash screenshot
  1. Launch app, select any JS or CSS file.
  2. Check “SHA 384” in algorithm section。
  3. Click “Calculate” button.
  4. By press and release Option key, you switch between Hex representation and Base64 representation of file hash.
  5. 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:

  1. Choose a JS or CSS file in Finder.
  2. Click the “Share” button on toolbar select “Calculate Hash”.
  3. In result window, check “SHA 384” and click “Calculate”.
  4. Press and hold Option key and double click to copy the hash result.
Base64 representation file hash in Finder integration

Isn’t that easy?

We hope you enjoy using our Finder integration and the new feature in this update.