Comments (9)
I will do a PR.
from uuid.
Running same code with "ramsey/uuid": "4.5.1"
does not give any collisions. So the bug is in new UnixTimeGenerator
.
from uuid.
The new code in UnixTimeGenerator
was mostly borrowed from symfony/uid. Can you reproduce the issue using their method for generating v7 UUIDs?
from uuid.
Can you reproduce the issue using their method for generating v7 UUIDs?
Yes, done.
from uuid.
See symfony/symfony#52367 for the fix
from uuid.
Thanks, @nicolas-grekas!
from uuid.
@ramsey @nicolas-grekas Hi! Have a question about uuid v7
collisions.
I need to replace 4-5 chars after generation uuid v7 with my specific characters (servers id or smth else).
At what positions would you advise me to change them so as not to greatly increase the chance of collisions?
from uuid.
@fannyfan414 , you can use UUID v8, it allows to put arbitrary content.
from uuid.
I would recommend using UUIDv8 for your use-case, by the way. It's intended for custom layouts like the one you're using.
To minimize chance of collision, I would probably place the server ID in the bytes to the far right of the UUID layout.
from uuid.
Related Issues (20)
- Misused Psalm Assertion for isValid() method? HOT 8
- Is there a way to force Uuid serialize to string instead of bytes ? HOT 7
- Could not find branch v5.x-dev anymore HOT 5
- Bad tag for 4.7.2 ? HOT 2
- ramsey/collection dependency requires PHP 8.1. HOT 2
- Ramsey\Uuid\Nonstandard namespace conflicts with itself in standalone builds HOT 2
- Unserialize error with OrderedTimeCodec HOT 2
- Remove the deleted tag in packagist.org HOT 3
- Deprecated: Return type of Ramsey\Uuid\Uuid::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): HOT 5
- Bump Bump brick/math from ^0.10 to ^0.11 HOT 2
- Mariadb 10.7+ uuid v7 sort HOT 1
- Interface 'Ramsey\Uuid\Provider\TimeProviderInterface' not found HOT 1
- Deprecated Implements of Serializable in UuidInterface HOT 1
- Use a PSR clock for internal time management?
- Update brick/math to support v0.12.0
- Inconsistent results between fromString and isValid methods. HOT 2
- Uuid v7 generated in wrong order HOT 3
- Why doesn't this library use `hrtime()` for monotonicity? HOT 1
- Where is uuid7 method ?? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uuid.