mirror of
https://github.com/strapi/strapi.git
synced 2025-09-22 23:09:47 +00:00
14 lines
298 B
JavaScript
14 lines
298 B
JavaScript
'use strict';
|
|
|
|
const crypto = require('crypto');
|
|
|
|
module.exports = {
|
|
hashAdminUser(payload) {
|
|
if (typeof payload === 'string') {
|
|
return crypto.createHash('sha256').update(payload).digest('hex');
|
|
}
|
|
|
|
return crypto.createHash('sha256').update(payload.email).digest('hex');
|
|
},
|
|
};
|