Skip to content

Allow 0x prefix for hex strings#3011

Merged
Marsup merged 2 commits intohapijs:masterfrom
BolajiOlajide:bo/allow-hex-with-prefix
Jan 17, 2024
Merged

Allow 0x prefix for hex strings#3011
Marsup merged 2 commits intohapijs:masterfrom
BolajiOlajide:bo/allow-hex-with-prefix

Conversation

@BolajiOlajide
Copy link
Contributor

Closes #2386

This PR updates the regex for validating hexadecimal. This allows hexes with the 0x prefix to be validated properly and those without to also pass validation provided they're valid hex strings.

CleanShot 2024-01-10 at 03 03 26@2x

@BolajiOlajide
Copy link
Contributor Author

Kindly take a look @Marsup

@Marsup
Copy link
Collaborator

Marsup commented Jan 15, 2024

Thanks for the PR. This feels like we should add an option (defaulting to false) to support this, otherwise I would consider it a breaking change. It would probably be more flexible anyway.

@BolajiOlajide BolajiOlajide force-pushed the bo/allow-hex-with-prefix branch from bd20d3a to 32528e0 Compare January 16, 2024 23:58
@BolajiOlajide
Copy link
Contributor Author

Thanks for the PR. This feels like we should add an option (defaulting to false) to support this, otherwise I would consider it a breaking change. It would probably be more flexible anyway.

Updated!

@Marsup Marsup added this to the 17.12.0 milestone Jan 17, 2024
@Marsup Marsup self-assigned this Jan 17, 2024
@Marsup
Copy link
Collaborator

Marsup commented Jan 17, 2024

I'm going to do some changes before releasing it but it's already a good start, thanks a lot!

@Marsup Marsup merged commit d2a9082 into hapijs:master Jan 17, 2024
Marsup added a commit that referenced this pull request Jan 17, 2024
@Marsup Marsup added the feature New functionality or improvement label Jan 17, 2024
@Marsup Marsup mentioned this pull request Jan 17, 2024
@richardpringle
Copy link

🙌

@BolajiOlajide BolajiOlajide deleted the bo/allow-hex-with-prefix branch May 5, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow 0x prefix for hex strings

3 participants