diff --git a/lib/galleryCrypto.ts b/lib/galleryCrypto.ts index cf650d6..c1e63b0 100644 --- a/lib/galleryCrypto.ts +++ b/lib/galleryCrypto.ts @@ -28,7 +28,7 @@ export async function packDoc(docStr: string): Promise { } export async function unpackDoc(blob: Uint8Array): Promise { - if (blob.length < HEADER_LEN) { + if (blob.length < HEADER_LEN + 1) { throw new Error("文件太小,不是合法的分享文件"); } for (let i = 0; i < MAGIC.length; i++) {