2019-05-13 01:15:27 -04:00
|
|
|
const crypto = require('crypto')
|
2021-12-24 20:18:12 -05:00
|
|
|
const path = require('path')
|
2019-05-13 01:15:27 -04:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
/**
|
|
|
|
* Generate unique hash from page
|
|
|
|
*/
|
|
|
|
generateHash(assetPath) {
|
|
|
|
return crypto.createHash('sha1').update(assetPath).digest('hex')
|
2021-12-24 20:18:12 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
getPathInfo(assetPath) {
|
|
|
|
return path.parse(assetPath.toLowerCase())
|
2019-05-13 01:15:27 -04:00
|
|
|
}
|
|
|
|
}
|