mirror of
https://github.com/strapi/strapi.git
synced 2025-09-24 07:50:33 +00:00
20 lines
346 B
JavaScript
20 lines
346 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');
|
||
|
},
|
||
|
};
|