Skip to content

duplicate ids being generated #11

@jorgheymans

Description

@jorgheymans

I was a bit surprised to see that this code in a unit test produces two duplicates:

        IdGenerator snowflake = IdGenerators.newSnowflakeIdGenerator();
        for (int i = 0; i < 10; i++) {
            String id = snowflake.generateId(1000).asString();
            System.out.println(id);
        }

output:

ffffffffffed8000
ffffffffffed8000
ffffffffffed8001
ffffffffffed8002
ffffffffffed8003
ffffffffffed8004
ffffffffffed8005
ffffffffffed8006
ffffffffffed8000
ffffffffffed8001

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions