Skip to content

Commit 694dcd8

Browse files
committed
Small Clean up
1 parent 84dc8bb commit 694dcd8

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

JavyInputAppendix.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,13 @@ function index(input) {
6868
if (input.method == "WENYAN") {
6969
if (input.inputType == "TEXT") {
7070
let Abra = new Abracadabra(input.inputType, input.outputType);
71-
Abra.WenyanInput(input.input, input.mode, input.key, input.WenyanConfig);
71+
Abra.WenyanInput(
72+
input.input,
73+
input.mode,
74+
input.key,
75+
input.WenyanConfig,
76+
input.AdvancedEncConfig
77+
);
7278
let Output = Abra.Output();
7379
if (input.outputType == "UINT8") {
7480
Output = uint8ArrayToBase64(Output);
@@ -77,7 +83,13 @@ function index(input) {
7783
} else if (input.inputType == "UINT8") {
7884
let Abra = new Abracadabra(input.inputType, input.outputType);
7985
let UINT8In = base64ToUint8Array(input.input);
80-
Abra.WenyanInput(UINT8In, input.mode, input.key, input.WenyanConfig);
86+
Abra.WenyanInput(
87+
UINT8In,
88+
input.mode,
89+
input.key,
90+
input.WenyanConfig,
91+
input.AdvancedEncConfig
92+
);
8193
let Output = Abra.Output();
8294
if (input.outputType == "UINT8") {
8395
Output = uint8ArrayToBase64(Output);

src/javascript/CoreHandler.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,13 @@ export function Dec(
266266
//解压缩
267267
TempStr2Int = Decompress(TempStr2Int);
268268
} catch (err) {
269-
/* v8 ignore next 3 */
270269
//解压缩/解密失败,丢出错误。
271-
throw "Error Decoding. Bad Input or Incorrect Key.";
270+
/* v8 ignore next 6 */
271+
if (typeof err == "string") {
272+
throw err;
273+
} else {
274+
throw "Error Decoding. Bad Input or Incorrect Key.";
275+
}
272276
}
273277

274278
if (!CheckLuhnBit(TempStr2Int)) {

0 commit comments

Comments
 (0)