Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding impl for core::ops::BitXor #297

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

necrobious
Copy link

An impl of bit-wise xor of two Bytes, returning None if both Bytes are not of the same length.

@necrobious necrobious changed the title adding impl for std::ops::BitXor adding impl for core::ops::BitXor Oct 5, 2019
@carllerche
Copy link
Member

Thanks for submitting this.

Could you provide the motivation. Is there prior art for bitwise ops implemented on slices in std?

@necrobious
Copy link
Author

Great question. To be honest, I'm not certain. I'm fairly new to rust, so still learning my way around. I was working with a crate that was using Bytes, and wanted a simple way to xor two sha256 slices together (an example of this, using slices) . I'm a new user to Bytes, so i took the opportunity to add this update for my project, and learn a little bit about Bytes in the process. I opened the PR in case it was useful to others, feel free to close if it is not a good fit.
-cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants