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

Adds support for @bytes type #25

Merged
merged 2 commits into from
Feb 1, 2017
Merged

Adds support for @bytes type #25

merged 2 commits into from
Feb 1, 2017

Conversation

marrony
Copy link
Contributor

@marrony marrony commented Feb 1, 2017

Copy link
Contributor

@erickpintor erickpintor left a comment

Choose a reason for hiding this comment

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

I have a couple of questions.

_Value = FromUrlSafeBase64(base64);
}

public BytesV(params byte[] value)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this constructor allow for an array of bytes to come in instead of a varargs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes


static byte[] FromUrlSafeBase64(string urlSafe)
{
var base64 = urlSafe.Replace('_', '/').Replace('-', '+');
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a standard transformation? Is there a changes where actual underscores or dashes shouldn't be replaced?

Perhaps we should put a comment explaining this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Would you mind documenting that in the code for posterity?

Copy link
Contributor

@erickpintor erickpintor left a comment

Choose a reason for hiding this comment

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

LGTM

@marrony marrony merged commit 2a11f02 into master Feb 1, 2017
@marrony marrony deleted the bytes_type branch February 1, 2017 16:43
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.

None yet

2 participants