Show
Ignore:
Timestamp:
04/03/08 06:48:19 (4 years ago)
Author:
maxter
Message:

Removed the time-based generator, sys and ipc packages. Added more API documentation.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/scrapple/util/uuid/NameUuidGen.d

    r50 r56  
    99        With the functions in this module, UUIDs can be created from names 
    1010        that are unique within a name space. 
    11          
     11 
    1212        MD-5 or SHA-1 hashing algorithms can be used to generate a name-based UUID. 
    1313        If backward compatibility is not an issue, SHA-1 should be preferred. 
    14          
     14 
    1515        The functions are thread-safe. 
    1616 
     
    3939 
    4040    Uuid uuid = digest.binaryDigest; 
    41     uuid.ver = ver
    42     uuid.variant = UuidVariant.Standard
     41    uuid.versionTimeHigh = (uuid.versionTimeHigh & 0x0FFF) | (ver << 12)
     42    uuid.variantClockSeqHigh = (uuid.variantClockSeqHigh & 0x3F) | 0x80
    4343 
    4444    return uuid; 
     
    9696} 
    9797 
    98 version (UuidUnitTest) 
     98debug (UuidUnitTest) 
    9999{ 
    100100    import tango.io.Stdout; 
     
    125125 
    126126        // Namespace uuids 
    127         assert (NameSpaceUuids.dns  == cast(Uuid)"6ba7b810-9dad-11d1-80b4-00c04fd430c8"); 
    128         assert (NameSpaceUuids.url  == cast(Uuid)"6ba7b811-9dad-11d1-80b4-00c04fd430c8"); 
    129         assert (NameSpaceUuids.oid  == cast(Uuid)"6ba7b812-9dad-11d1-80b4-00c04fd430c8"); 
    130         assert (NameSpaceUuids.x500 == cast(Uuid)"6ba7b814-9dad-11d1-80b4-00c04fd430c8"); 
     127        assert (NameSpaceUuids.dns  == Uuid("6ba7b810-9dad-11d1-80b4-00c04fd430c8")); 
     128        assert (NameSpaceUuids.url  == Uuid("6ba7b811-9dad-11d1-80b4-00c04fd430c8")); 
     129        assert (NameSpaceUuids.oid  == Uuid("6ba7b812-9dad-11d1-80b4-00c04fd430c8")); 
     130        assert (NameSpaceUuids.x500 == Uuid("6ba7b814-9dad-11d1-80b4-00c04fd430c8")); 
    131131 
    132132    }