backup_filehash.js 315 B

123456789
  1. const crypto = require('crypto')
  2. /// Derive the name of the file inside of the backup from it's domain and file name.
  3. module.exports = function fileHash (file, domain) {
  4. domain = domain || 'HomeDomain'
  5. let shasum = crypto.createHash('sha1')
  6. shasum.update(`${domain}-${file}`)
  7. return shasum.digest('hex')
  8. }