Create a random (version 4) Universally Unique Identifier (UUID)
A UUID looks like "4042E716-2556-4715-90F0-C6518463B4E5" and is a random 128-bit number. This is sufficiently random that we can except zero collisions in any relevant timeframe, and so is useful for uniquely identifing simulations, for example.
If compiled with the preprocessor macro GK_HAS_LIBUUID > 0
, then
it uses a wrapper around the C libuuid
library (which must be
linked). Otherwise, uses a fallback random number generator.
This module contains its own implementation of the MT19937 psuedo-random number generator (PRNG) so that it doesn't intefere with the PRNG state used in the rest of the program.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | parameter | :: | uuid_len | = | 36 |
Length of the UUID character |
Convert a 1-byte integer into hexadecimal
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=c_signed_char), | intent(in) | :: | char |
Convert an array of 1-byte integers into UUID format: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=c_signed_char), | intent(in), | dimension(16) | :: | uuid_in |
Generate a version 4 UUID using either the libuuid library, or our own random number generator wrapper
Uses a method for getting a nice seed for the PRNG taken from gfortran documentation