### Fixed

- Unpaired UTF-16 surrogates produce wrong digests and consume the next code unit in the JS path. Unpaired surrogates are now encoded as U+FFFD, matching `TextEncoder` and Node.js `crypto`. #57

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Yi-Cyuan Chen
2026-11-16 16:37:59 +08:00
co-authored by Claude Opus 5.5
parent ee1c332b60
commit 68b5c32442
27 changed files with 273 additions and 111 deletions
+4
View File
@@ -45,6 +45,10 @@
'05fe3b294344f4e93c811e10f9825a38': ['中文', '中文'],
'c1bc6df91f38e6332b8562324005103d': ['aécio', 'aécio'],
'14eef78533c35078177d11fb4593a19e': ['𠜎', '𠜎']
},
'UTF8 unpaired surrogates': {
'2ef4c67742d4f436cbdfdbad133659af': ['\ud800', 'a\ud83db'],
'f537b6e97a3e8b23a9e87a29fb5c4173': ['a\udc00b', '\ud83d\ude00\udfff']
}
}
};