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

Cannot get Hex from Guid #314

Open
prolic opened this issue May 2, 2020 · 2 comments
Open

Cannot get Hex from Guid #314

prolic opened this issue May 2, 2020 · 2 comments
Labels

Comments

@prolic
Copy link

prolic commented May 2, 2020

To Reproduce...

$factory = new UuidFactory(new FeatureSet(true));
$guid = $factory->uuid4();
$hex= $guid->getHex();

Throws:

Ramsey\Uuid\Exception\InvalidArgumentException: The byte string received does not contain a valid version
@enumag
Copy link
Contributor

enumag commented Nov 26, 2020

ping @ramsey

@enumag
Copy link
Contributor

enumag commented Nov 26, 2020

The problem is that version is fetched from a different byte between the Guid Fields implementation and normal Fields implementation.

This difference is however not addressed in UuidFactory. As a result the version is in a different byte than where Guid Fields expects it.

I'm not sure what's the correct fix though. What is the correct bytes representation for GUIDs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants