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

Introduced xoring of String and a sequence of Bytes #1814

Merged
merged 3 commits into from
Nov 6, 2015

Conversation

ppepos
Copy link
Contributor

@ppepos ppepos commented Nov 5, 2015

Signed-off-by: Philippe Pepos Petitclerc ppeposp@gmail.com

Signed-off-by: Philippe Pepos Petitclerc <ppeposp@gmail.com>
#
# assert "goodmorning".xor(" ".to_bytes) == "GOODMORNING"
fun xor(key: SequenceRead[Byte]): String do
var xored = new Bytes.empty
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick optimization: new Bytes.with_capacity(bytelen.max(key.length))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps having the service on Text instead of String would be better ?

@xymus
Copy link
Contributor

xymus commented Nov 5, 2015

+1

@lbajolet
Copy link
Contributor

lbajolet commented Nov 5, 2015

:shipit:

Signed-off-by: Philippe Pepos Petitclerc <ppeposp@gmail.com>
Signed-off-by: Philippe Pepos Petitclerc <ppeposp@gmail.com>
@privat
Copy link
Member

privat commented Nov 5, 2015

test this please

privat added a commit that referenced this pull request Nov 6, 2015
Signed-off-by: Philippe Pepos Petitclerc <ppeposp@gmail.com>

Pull-Request: #1814
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
@privat privat merged commit 3575dd3 into nitlang:master Nov 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants