Skip to content

Commit

Permalink
fix(mdict-base.js): fix load error for mdx version 2.0 no encryption (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
songxiaocheng authored Jun 24, 2021
1 parent 9720de0 commit 1d4fff8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/mdict-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ var MDictBase = /*#__PURE__*/function () {

if (this._encrypt === 2) {
kbInfoCompBuff = _common["default"].mdxDecrypt(keyBlockInfoBuff);
} else if (this._encrypt === 0) {
kbInfoCompBuff = keyBlockInfoBuff;
} // For version 2.0, will compress by zlib, lzo just just for 1.0
// key_block_info_compressed[0:8] => compress_type

Expand Down
2 changes: 2 additions & 0 deletions src/mdict-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ class MDictBase {
let kbInfoCompBuff;
if (this._encrypt === 2) {
kbInfoCompBuff = common.mdxDecrypt(keyBlockInfoBuff);
} else if (this._encrypt === 0) {
kbInfoCompBuff = keyBlockInfoBuff;
}
// For version 2.0, will compress by zlib, lzo just just for 1.0
// key_block_info_compressed[0:8] => compress_type
Expand Down

0 comments on commit 1d4fff8

Please sign in to comment.