flashultra / uuid Goto Github PK
View Code? Open in Web Editor NEWGenerates the RFC-4122 UUIDs , NanoId, FlakeId, Short-UUID
License: MIT License
Generates the RFC-4122 UUIDs , NanoId, FlakeId, Short-UUID
License: MIT License
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.
Similarly to your hxprng library, this has become incompatible with haxelib for Haxe 4. I'm about to open a PR to fix it.
uuid/2,4,0/src/uuid/Uuid.hx:36: characters 80-84 : Accessing this field requires a system platform (php,neko,cpp,etc.)
uuid/2,4,0/src/uuid/Uuid.hx:36: characters 80-84 : ... For function argument 'f'
refers to this line
static var rndSeed:Int64 = Int64.fromFloat(#if js js.lib.Date.now() #else Sys.time()*1000 #end);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.