-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
inherit "/packages/uuid/src/uuid.c"; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
# uuid.c | ||
|
||
Found in: | ||
|
||
[LPCsnippets Github Repository](https://github.com/atari2600tim/LPCsnippets/blob/master/uuid.c). | ||
|
||
## Info | ||
|
||
This is a "version 4" uuid. This is based on random numbers, the others use time. | ||
https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random) | ||
supposed to use lower case but accept upper case (so run lower_case when comparing incoming stuff) | ||
|
||
Author unknown. | ||
|
||
Example: | ||
|
||
``` | ||
> exec return "/packages/uuid/src/uuid.c"->uuid() | ||
Result: | ||
"be97d609-4d5d-4e35-9b17-00a2f85d353f" | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
string uuid() | ||
{ | ||
// This is a "version 4" uuid. This is based on random numbers, the others use time. | ||
// https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random) | ||
// supposed to use lower case but accept upper case (so run lower_case when comparing incoming stuff) | ||
|
||
return sprintf("%04x%04x-%04x-4%03x-%0x%03x-%04x%04x%04x", | ||
random(0x10000),random(0x10000),random(0x10000),random(0x1000), | ||
(8+random(4)), random(0x1000),random(0x10000),random(0x10000),random(0x10000)); | ||
} |