feat(uuid): add Base32 parsing API#17
Merged
Merged
Conversation
- Add Uuid::fromBase32() for parsing UUID Base32 values - Cover uppercase, lowercase, and invalid Base32 inputs - Document Base32 parsing in the README Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Added
Uuid::fromBase32()as the matching parser for UUID values emitted withUuidWrapper::toBase32().The package already supports converting UUIDs to Base32, but there was no explicit package-level API for parsing that representation back into a UUID.
fromString()also supports ULIDs, which share the same 26-character Crockford Base32 shape, so using a dedicated method makes the caller’s intent clear: parse this value as a UUID Base32 value.This keeps Base32 UUID parsing available through the package API and avoids requiring application code to use the underlying Symfony UID classes directly.
Example:
The change includes tests for uppercase input, lowercase input, and invalid input. The user guide was updated with a Base32 parsing example.
Checklist: