@ddunigma/node 1.0.23 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/test/test3.js +2 -2
- package/dist/mjs/index.js +2 -2
- package/dist/mjs/test/test3.js +2 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -87,7 +87,7 @@ class Ddu64 {
|
|
|
87
87
|
return Buffer.from(buffer);
|
|
88
88
|
}
|
|
89
89
|
encode(input, options = {}) {
|
|
90
|
-
const { dduSetSymbol = "default", encoding = this.defaultEncoding, usePowerOfTwo =
|
|
90
|
+
const { dduSetSymbol = "default", encoding = this.defaultEncoding, usePowerOfTwo = true, } = options;
|
|
91
91
|
const bufferInput = typeof input === "string" ? Buffer.from(input, encoding) : input;
|
|
92
92
|
const { dduSet, padChar, dduLength, bitLength } = this.getSelectedSets(dduSetSymbol, usePowerOfTwo);
|
|
93
93
|
const { dduBinary, padding } = this.bufferToDduBinary(bufferInput, bitLength);
|
|
@@ -108,7 +108,7 @@ class Ddu64 {
|
|
|
108
108
|
: resultString;
|
|
109
109
|
}
|
|
110
110
|
decode(input, options = {}) {
|
|
111
|
-
const { dduSetSymbol = "default", encoding = this.defaultEncoding, usePowerOfTwo =
|
|
111
|
+
const { dduSetSymbol = "default", encoding = this.defaultEncoding, usePowerOfTwo = true, } = options;
|
|
112
112
|
const { dduSet, dduLength, bitLength, lookupTable, paddingRegExp } = this.getSelectedSets(dduSetSymbol, usePowerOfTwo);
|
|
113
113
|
const paddingCount = (input.match(paddingRegExp) || []).length;
|
|
114
114
|
const paddingBits = paddingCount * 2;
|
package/dist/cjs/test/test3.js
CHANGED
|
@@ -5,12 +5,12 @@ const secret = "Asqr0z3ty1524EBCQFRTUWVXYZbacdD+GLHIJKMONfehgPiSklmujvnop9w678x/
|
|
|
5
5
|
const padding = "=";
|
|
6
6
|
function encryptDdu64(content) {
|
|
7
7
|
const custom64 = new __1.Custom64();
|
|
8
|
-
const encoded = custom64.encode(content
|
|
8
|
+
const encoded = custom64.encode(content);
|
|
9
9
|
return encoded;
|
|
10
10
|
}
|
|
11
11
|
function decryptDdu64(content) {
|
|
12
12
|
const custom64 = new __1.Custom64();
|
|
13
|
-
const decoded = custom64.decode(content
|
|
13
|
+
const decoded = custom64.decode(content);
|
|
14
14
|
return decoded;
|
|
15
15
|
}
|
|
16
16
|
console.log("타운카 너무좋아123");
|
package/dist/mjs/index.js
CHANGED
|
@@ -86,7 +86,7 @@ export class Ddu64 {
|
|
|
86
86
|
return Buffer.from(buffer);
|
|
87
87
|
}
|
|
88
88
|
encode(input, options = {}) {
|
|
89
|
-
const { dduSetSymbol = "default", encoding = this.defaultEncoding, usePowerOfTwo =
|
|
89
|
+
const { dduSetSymbol = "default", encoding = this.defaultEncoding, usePowerOfTwo = true, } = options;
|
|
90
90
|
const bufferInput = typeof input === "string" ? Buffer.from(input, encoding) : input;
|
|
91
91
|
const { dduSet, padChar, dduLength, bitLength } = this.getSelectedSets(dduSetSymbol, usePowerOfTwo);
|
|
92
92
|
const { dduBinary, padding } = this.bufferToDduBinary(bufferInput, bitLength);
|
|
@@ -107,7 +107,7 @@ export class Ddu64 {
|
|
|
107
107
|
: resultString;
|
|
108
108
|
}
|
|
109
109
|
decode(input, options = {}) {
|
|
110
|
-
const { dduSetSymbol = "default", encoding = this.defaultEncoding, usePowerOfTwo =
|
|
110
|
+
const { dduSetSymbol = "default", encoding = this.defaultEncoding, usePowerOfTwo = true, } = options;
|
|
111
111
|
const { dduSet, dduLength, bitLength, lookupTable, paddingRegExp } = this.getSelectedSets(dduSetSymbol, usePowerOfTwo);
|
|
112
112
|
const paddingCount = (input.match(paddingRegExp) || []).length;
|
|
113
113
|
const paddingBits = paddingCount * 2;
|
package/dist/mjs/test/test3.js
CHANGED
|
@@ -3,12 +3,12 @@ const secret = "Asqr0z3ty1524EBCQFRTUWVXYZbacdD+GLHIJKMONfehgPiSklmujvnop9w678x/
|
|
|
3
3
|
const padding = "=";
|
|
4
4
|
function encryptDdu64(content) {
|
|
5
5
|
const custom64 = new Custom64();
|
|
6
|
-
const encoded = custom64.encode(content
|
|
6
|
+
const encoded = custom64.encode(content);
|
|
7
7
|
return encoded;
|
|
8
8
|
}
|
|
9
9
|
function decryptDdu64(content) {
|
|
10
10
|
const custom64 = new Custom64();
|
|
11
|
-
const decoded = custom64.decode(content
|
|
11
|
+
const decoded = custom64.decode(content);
|
|
12
12
|
return decoded;
|
|
13
13
|
}
|
|
14
14
|
console.log("타운카 너무좋아123");
|