ramsey / uuid

:snowflake: A PHP library for generating universally unique identifiers (UUIDs).
https://uuid.ramsey.dev
MIT License
12.46k stars 501 forks source link

Allow for a different PRNG #1

Closed marijn closed 9 years ago

marijn commented 12 years ago

First of, great job! This seems to be one of the most solid UUID implementations for PHP.

I was wondering if you would mind having a dedicated UuidGenerator class which would house all the factories for generating the different Uuid implementations. In particular, this would allow us to inject a different PRNG.

Are you open to such a change?

ramsey commented 12 years ago

That sounds good to me. Are you thinking of moving the static methods in Uuid out to a UuidGenerator class and allowing for a new PRNG to be statically set on the UuidGenerator (or something like that)?

marijn commented 12 years ago

Not statically. It would just be an instance property. I'll post some pseudo code later today.

ramsey commented 11 years ago

@marijn, I'm just curious where this stands and whether you're still thinking of implementing this.

marijn commented 11 years ago

I'm definitely still thinking of implementing this. However, I do have a lot on my plate at the moment so it's definitely not going to be anytime soon.

RSully commented 10 years ago

Any more thought put into this?

marijn commented 10 years ago

I wish I had more :clock1:

ramsey commented 10 years ago

I'm wondering if this could be related to some of the discussion on #34 and as a better implementation to support GUIDs and other UUIDs.

@marijn, if you could sketch out some of your ideas for the interface for the UuidGenerator, I could help get started on the internals for this. I'm targeting the 3.0 branch for this.

ramsey commented 9 years ago

This work has been merged into the 3.0 branch.