Skip to content

Add byteAligned option to hex string #1422

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

Merged
merged 1 commit into from
Apr 27, 2018
Merged

Conversation

kanongil
Copy link
Contributor

@kanongil kanongil commented Feb 6, 2018

In most cases you probably want to create a byte-based representation from the hex string.

This PR adds a new byteAligned option, which will fail the validation when eg. new Buffer(value, 'hex') would fail due to bad alignment.

Due to semver, the option is considered false by default, preserving the existing behavior in all cases. I would probably switch this to true by default, when possible.

@Marsup
Copy link
Collaborator

Marsup commented Mar 9, 2018

Do you think we should apply convert to it and add padding to automatically accept odd numbers ? This feels like a breaking change if we want to properly add this option to describe. 🤔

@Marsup Marsup added the feature New functionality or improvement label Mar 9, 2018
@Marsup Marsup self-assigned this Mar 9, 2018
@Marsup Marsup added this to the 13.3.0 milestone Apr 27, 2018
@Marsup Marsup merged commit ed65256 into hapijs:master Apr 27, 2018
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants