greenlock-store-sequelize.js/make-safe-sha-str.js

10 lines
220 B
JavaScript
Raw Permalink Normal View History

'use strict';
var crypto = require('crypto');
module.exports = function (str) {
return crypto
.createHash('sha256').update(str).digest('base64')
.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
};