Repository navigation
Added trimming to ComputeHashValue to handle names over 4096 bytes. - #4941
OsirisTerje merged 3 commits into
Conversation
- Added unit test for this case.
|
@dotnet-policy-service agree company="PropertyMe" |
- Added unit test for Chinese characters.
mikkelbu
left a comment
There was a problem hiding this comment.
I don't know much about Encoder, but as far as I can tell this looks sound.
Is it possible to have a test that it actually uses the first 4096 bytes in hashvalue (I guess it don't have to be exactly 4096)? AFAICT the added tests would also pass if the code was accidentally changed to e.g. only use the first couple bytes.
|
Hey @mikkelbu the two tests provided are both over 4096 bytes. Just to clarify, the concern is if those tests were changed to be less than 4096 bytes - they would still pass? |
Sorry about the long answer time. I was just wondering if it would make sense to have a test that checks that two names that are distinct (but after 4096 bytes) are considered equal by ComputeHashValue), but I don't think this add much. |
This PR addresses #4937 by adding in trimming for names above 4096 bytes, including a unit test to check for this case.