I'm developing a multi-process solution and have to assign 6 digit unique numbers to some objects (specifying more than 6 digits or using alphanumeric characters is not possible. The length of this number is a third-party constraint).
since this is a multi-process solution (Multiple instances of my application will be run at the same time), I cannot depend on using lock with shared variables in my project and I'd like to prevent using shared storage (db/file system/...) to maintain and generate these unique numbers.
Also, It's highly unlikely that I need more than 300,000 unique numbers per day.
Is there an algorithm (probably dependent on time of day) that can generate unique 6-digit numbers per day?