初始提交

This commit is contained in:
2026-01-04 11:09:06 +08:00
commit 8fa31df250
1326 changed files with 213907 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
'use strict';
import _constants from './constants'
// Encode data string
var encode = function encode(data, structure, separator) {
var encoded = data.split('').map(function(val, idx) {
return _constants.BINARIES[structure[idx]];
}).map(function(val, idx) {
return val ? val[data[idx]] : '';
});
if (separator) {
var last = data.length - 1;
encoded = encoded.map(function(val, idx) {
return idx < last ? val + separator : val;
});
}
return encoded.join('');
};
export default encode