Skip to content

Commit 7043ea4

Browse files
chore: update test regex pattern for ciphertext
1 parent d4a9e1f commit 7043ea4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/index.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ describe("Phase", () => {
5858
expect(segments[4]).toBe(tag);
5959
// Check if the one-time public key and ciphertext are valid hex strings
6060
expect(segments[2]).toMatch(/^[0-9a-f]+$/);
61-
expect(segments[3]).toMatch(/^[0-9a-f]+$/);
61+
expect(segments[3]).toMatch(
62+
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
63+
);
6264
});
6365

6466
test("Check if Phase encrypt always produces ciphertexts (ph:*) of the same length for the same plaintext", async () => {

0 commit comments

Comments
 (0)