Feature - Ability to specify GUID or generate pseudo-GUID #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
sh
script and program now can accept optional-G
switch followed by GUID in one of three UUID formats:windows(38 symbols) -
{00000000-0000-4000-8000-000000000000}
general(36 symbols) -
00000000-0000-4000-8000-000000000000
dashless(32 symbols) -
00000000000040008000000000000000
used GUID is UUID version 4 variation 1
if GUID is specified - its certain bytes will be validated according to RFC 9562 section 4.1 and 4.2 plus dash and curly braces, all based on the value length.
if not specified - pseudo-GUID will be generated
if specified GUID is invalid - program will exit with error message and code 1
switch is optional, but default value not specified because value, produced by for-loop is actually invalid UUIDv4.
So you can use one of the GUID that were commented in main() or keep it blank and let program generate it
commented GUIDs in general format:
E36743DD-AB2B-44E1-B7CB-EC31CEB9D5A6
01FCABEF-D84F-4247-A00B-7C788E6DD1C1
5BA57258-F3FE-46CD-913C-EF00C77A9769
5BA57259-F3FE-46CD-913C-EF00C77A9769
note: generator uses
srand()
(allowed by RFC) and so GUID called pseudo, so you can generate one with other tool and use itnote:
sh
script not tested on live system, only some constructions, used in it, in online compilersnote: this feature assumed to be merged on top of the time feature, but not necessary. On merging after the time feature there expected few conflicts, be careful with
getopt do:h:O:A:
lines