Created
June 12, 2023 05:48
-
-
Save singularitti/13dc82ef6ebac5b20d128cfa783137fd to your computer and use it in GitHub Desktop.
Generate unique random IDs #Julia
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # See https://github.com/cihga39871/JobSchedulers.jl/blob/aca52de/src/jobs.jl#L6-L10 | |
| function generate_id() | |
| time_value = (now().instant.periods.value - 63749462400000) << 16 | |
| rand_value = rand(UInt16) | |
| time_value + rand_value | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment