Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compute cache busting hash
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