GithubHelp home page GithubHelp logo

flashultra / uuid Goto Github PK

View Code? Open in Web Editor NEW
25.0 3.0 3.0 64 KB

Generates the RFC-4122 UUIDs , NanoId, FlakeId, Short-UUID

License: MIT License

Haxe 100.00%
flakeid nanoid short-uuid uuid uuid-generator uuids uuidv4 unique-id snowflake twitter-snowflake

uuid's People

Contributors

flashultra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

uuid's Issues

V4 generator is deterministic on Neko

I've run into bugs because on Neko, Uuid.v4() always returns the same sequence of ids in each run-through of a program.

To reproduce this problem:

haxelib install ihx
haxelib install uuid
haxelib run ihx -neko -lib uuid
>> [uuid.Uuid.v1(),uuid.Uuid.v4()] 
Array<String> : [0f642390-1cd0-11b2-8cf0-19ff53c1a638,190b6fa6-6558-4f1a-b0e0-48466ef3f225]
>> [uuid.Uuid.v1(),uuid.Uuid.v4()] 
Array<String> : [0f666d80-1cd0-11b2-8cf0-452fa3a84843,10182a8d-d1af-4304-ae27-cf42283ebaa7]
>> exit
haxelib run ihx -neko -lib uuid
>> [uuid.Uuid.v1(),uuid.Uuid.v4()]
Array<String> : [0f733ec0-1cd0-11b2-8cf0-19ff53c1a638,190b6fa6-6558-4f1a-b0e0-48466ef3f225]
>> [uuid.Uuid.v1(),uuid.Uuid.v4()]
Array<String> : [0f78bd00-1cd0-11b2-8cf0-452fa3a84843,10182a8d-d1af-4304-ae27-cf42283ebaa7]

You can see that the v1() results are different in between program sessions, but the v4() results are the same. I expected v4() to return a unique id 99.999999999999999999999999% of the time, and never to see a collision in my lifetime, even between different program sessions.

Incompatible with Haxe 4

Similarly to your hxprng library, this has become incompatible with haxelib for Haxe 4. I'm about to open a PR to fix it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.