alphazframework / framework

Core files of AlphaZ Framework
https://alphazframework.github.io/
MIT License
16 stars 17 forks source link

Add UUID component #219

Open peter279k opened 5 years ago

peter279k commented 5 years ago

Is your feature request related to a problem? Please describe.

I'm not sure we have to provide this component by dafault on our Zest framework.

Describe the solution you'd like

We can look at the ramsey/uuid to know more details about UUID.

And this official uniqid function reference can also let us know UUID.

lablnet commented 5 years ago

Yes i was thinking before, its should be part of Zest Framework, its good if you could send PR what do you think @peter279k

peter279k commented 5 years ago

Thanks @Lablnet, and I also have the similar issue on this :).

lablnet commented 5 years ago

I have following approach in my mind

  1. Generate random characters 10 or 15 by using salts method from Site class.
  2. Generating random number from 100000 to 1000000 and then multiply by it time().
  3. Then concatenate those and shuffle it.
  4. For providing additional sticky rule we can make optional feature allow user to validate it, like when ever it generate UUID we can append it to json, and verify it either already exist or not if so, do it again.... but this will be optional

What do you think @peter279k

peter279k commented 5 years ago

@Lablnet, thanks for your reply.

The UUID means the unique ID value.

It's also a random value, this generation has the standard defined by RFC-4122.

It's also have the implementation here.