2017-03-17 18:07:35 +08:00
|
|
|
/**
|
2018-05-25 15:35:26 +08:00
|
|
|
*
|
2017-03-17 18:07:35 +08:00
|
|
|
* @authors yutent (yutent@doui.cc)
|
|
|
|
* @date 2017-01-17 15:50:51
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-05-25 15:35:26 +08:00
|
|
|
'use strict'
|
2017-03-17 18:07:35 +08:00
|
|
|
|
|
|
|
const crypto = require('crypto')
|
|
|
|
|
2018-05-25 15:35:26 +08:00
|
|
|
module.exports = function(str = '') {
|
|
|
|
return crypto
|
|
|
|
.createHash('md5')
|
|
|
|
.update(str + '', 'utf8')
|
|
|
|
.digest('hex')
|
|
|
|
}
|