Move key encoding to socket api#15
Merged
Merged
Conversation
This was referenced Mar 13, 2026
Merged
Member
Author
669508e to
5f8b812
Compare
05a41dd to
8f8b51e
Compare
5f8b812 to
c1493e0
Compare
8f8b51e to
53428a9
Compare
c1493e0 to
a566b68
Compare
978f263 to
e10435b
Compare
a566b68 to
3f2d7e2
Compare
e10435b to
6ebdcec
Compare
3f2d7e2 to
9f5a863
Compare
|
@claude review this PR |
9f5a863 to
f9ac819
Compare
6ebdcec to
7815d98
Compare
f9ac819 to
f714a41
Compare
09802be to
c5237c1
Compare
xmartinez
approved these changes
Mar 25, 2026
xmartinez
left a comment
There was a problem hiding this comment.
LG!
Added a comment re: test coverage (non blocking).
c5237c1 to
e46fe95
Compare
e46fe95 to
3cc05e3
Compare
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation / Description
This change enhances the memcache client to handle arbitrarily long keys by implementing automatic key hashing with Blake2b. Previously, keys were limited to 250 bytes (or 187 bytes for binary keys due to base64 encoding).
This was previously implemented in meta-memcache library in python, but supporting it at the socket level makes for a more robust api. The implementation is backwards compatible, and usages can implement their own key encoding if they wish to or they need backwards compatibility. The keys are unmodified as long as they are non-binary and < 187 bytes, which key encoders should guarantee.
Moving the default encoding to rust provides a small performance gains as well.
Changes introduced
Union[str, bytes]instead of justbytes