Created
December 27, 2018 20:41
-
-
Save benji6/9c3ee508ff52b40f2aaa53c5feff0baf to your computer and use it in GitHub Desktop.
Compute cache busting hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto') | |
const computeHash = data => | |
crypto | |
.createHash('md5') | |
.update(data) | |
.digest('base64') | |
.replace(/\+/g, '-') | |
.replace(/\//g, '_') | |
.replace(/=+$/, '') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment