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