biofriction-wp-theme/node_modules/rev-hash/index.js

11 lines
274 B
JavaScript
Raw Normal View History

2021-10-26 14:18:09 +02:00
'use strict';
const crypto = require('crypto');
module.exports = input => {
if (typeof input !== 'string' && !Buffer.isBuffer(input)) {
throw new TypeError('Expected a Buffer or string');
}
return crypto.createHash('md5').update(input).digest('hex').slice(0, 10);
};