@cse-public/webex-node-bot-framework
Version:
Webex Teams Bot Framework for Node JS
39 lines (32 loc) • 645 B
JavaScript
;
var uuid = require('uuid');
var Utils = {};
/**
* Base64 encode a string
* @function
* @private
* @param {String} string
* @returns {String} Base64 encoded string.
*/
Utils.base64encode = function(string) {
return new Buffer.from(string).toString('base64');
};
/**
* Generate UUID string
* @function
* @private
* @returns {String} UUID string.
*/
Utils.genUUID = function() {
return uuid.v4();
};
/**
* Generate a Base64 encoded UUID
* @function
* @private
* @returns {String} Base64 encoded UUID.
*/
Utils.genUUID64 = function() {
return Utils.base64encode(Utils.genUUID());
};
module.exports = Utils;