merge fix for #878

This commit is contained in:
Guenter Obiltschnig
2015-07-31 12:17:20 +02:00
parent 5781bcbe35
commit e4dcb85c1f
6 changed files with 116 additions and 20 deletions

View File

@@ -46,10 +46,12 @@ class Foundation_API UUID
public:
enum Version
{
UUID_TIME_BASED = 0x01,
UUID_DCE_UID = 0x02,
UUID_NAME_BASED = 0x03,
UUID_RANDOM = 0x04
UUID_TIME_BASED = 0x01,
UUID_DCE_UID = 0x02,
UUID_NAME_BASED = 0x03,
UUID_RANDOM = 0x04,
UUID_NAME_BASED_SHA1 = 0x05
};
UUID();
@@ -141,7 +143,7 @@ protected:
static void appendHex(std::string& str, UInt8 n);
static void appendHex(std::string& str, UInt16 n);
static void appendHex(std::string& str, UInt32 n);
static UInt8 nibble(char hex);
static Int16 nibble(char hex);
void fromNetwork();
void toNetwork();

View File

@@ -61,6 +61,13 @@ public:
UUID createFromName(const UUID& nsid, const std::string& name, DigestEngine& de);
/// Creates a name-based UUID, using the given digest engine.
///
/// Note: in order to create a standard-compliant UUID, the given DigestEngine
/// must be either an instance of MD5Engine or SHA1Engine. The version field of
/// the UUID will be set accordingly.
UUID createFromName(const UUID& nsid, const std::string& name, DigestEngine& de, UUID::Version version);
/// Creates a name-based UUID, using the given digest engine and version.
UUID createRandom();
/// Creates a random UUID.