welsonjs/lib/base64.js

21 lines
733 B
JavaScript
Raw Normal View History

2020-07-07 17:06:38 +00:00
////////////////////////////////////////////////////////////////////////
// Base64 API
////////////////////////////////////////////////////////////////////////
2022-01-17 16:10:57 +00:00
//var XML = require("lib/xml");
var PS = require("lib/powershell");
2020-11-05 03:04:50 +00:00
exports.encode = function(sText) {
2022-01-17 16:10:57 +00:00
return PS.execScript("app\\assets\\ps1\\base64encode", [sText]).trim();
//return XML.create().createElement("base64").encode(sText, "bin.base64");
2020-07-07 17:06:38 +00:00
};
exports.decode = function(vCode) {
2022-01-17 16:10:57 +00:00
return PS.execScript("app\\assets\\ps1\\base64decode", [vCode]).trim();
//return XML.create().createElement("base64").decode(vCode, "bin.base64");
2020-07-07 17:06:38 +00:00
};
2020-11-09 10:06:34 +00:00
2022-01-17 16:10:57 +00:00
exports.VERSIONINFO = "Base64 Module (base64.js) version 0.3";
2020-11-09 10:06:34 +00:00
exports.global = global;
exports.require = require;