Add support for UUID generation
Design:
There are three methods to generate the UUID:
1. Using libuuid
: This method is followed when libuuid
is available and is the preferred method to generate the UUID.
2. Using uuid_create()
from uuid.h
: This method is followed when libuuid
is not available.
3. Using the fallback mechanism: The file uri.c
contains a fallback mechanism for generating the UUID using random numbers generated using the gnulib random
module. This mechanism is a slightly modified version of the one used in Wget for the same purpose. This method is not preferred if either of the above two methods are possible.
Testing:
There is one automated test written to test the UUIDs generated by the above mechanisms. It essentially checks:
- If the characters in the generated UUID string belong to the character set of UUID strings (
0-9
,a-f
and-
). - If the string follows the pattern:
8-4-4-4-12
.
Closes #6 (closed)
Edited by Suhas K S