前端 uni-app 重写: 9页面 H5

This commit is contained in:
zhiqui
2026-11-15 15:09:37 +08:00
parent 513b53672e
commit ea7c2529e9
24104 changed files with 3667749 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
var utf8 = require('./utf8');
var hex = require('./hex');
var base64 = require('./base64');
exports = function(str) {
var encoding =
arguments.length > 1 && arguments[1] !== undefined
? arguments[1]
: 'utf8';
if (encoding === 'hex') return hex.decode(str);
if (encoding === 'base64') return base64.decode(str);
var bytes = [];
if (encoding === 'utf8') {
str = utf8.encode(str);
}
for (var i = 0, len = str.length; i < len; i++) {
bytes.push(str.charCodeAt(i) & 0xff);
}
return bytes;
};
module.exports = exports;