* removed the use of unit sockets

git-svn-id: trunk@5646 -
This commit is contained in:
ivost 2006-12-19 10:42:04 +00:00
parent 787ed7e230
commit 6a6c18b64a

View File

@ -21,7 +21,7 @@ interface
{$h+} {$h+}
uses uses
SysUtils, DateUtils, md5, sockets; SysUtils, DateUtils, md5;
@ -185,9 +185,9 @@ begin
(* put name space ID in network byte order so it hashes the same (* put name space ID in network byte order so it hashes the same
no matter what endian machine we're on *) no matter what endian machine we're on *)
net_nsid := nsid; net_nsid := nsid;
net_nsid.time_low := htonl(net_nsid.time_low); // net_nsid.time_low := htonl(net_nsid.time_low);
net_nsid.time_mid := htons(net_nsid.time_mid); // net_nsid.time_mid := htons(net_nsid.time_mid);
net_nsid.time_hi_and_version := htons(net_nsid.time_hi_and_version); // net_nsid.time_hi_and_version := htons(net_nsid.time_hi_and_version);
MDInit(c, MD_VERSION_4); MDInit(c, MD_VERSION_4);
MDUpdate(c, net_nsid, sizeof(net_nsid)); MDUpdate(c, net_nsid, sizeof(net_nsid));
@ -202,17 +202,19 @@ end;
{ uuid_create_sha1_from_name } { uuid_create_sha1_from_name }
procedure uuid_create_sha1_from_name(var uuid: uuid_t; const nsid: uuid_t; const name: string); procedure uuid_create_sha1_from_name(var uuid: uuid_t; const nsid: uuid_t; const name: string);
var begin
end;
{var
net_nsid: uuid_t; net_nsid: uuid_t;
{ c: TMDContext; c: TMDContext;
hash: TMDDigest;} hash: TMDDigest;
begin begin
(* put name space ID in network byte order so it hashes the same (* put name space ID in network byte order so it hashes the same
no matter what endian machine we're on *) no matter what endian machine we're on *)
net_nsid := nsid; // net_nsid := nsid;
net_nsid.time_low := htonl(net_nsid.time_low); // net_nsid.time_low := htonl(net_nsid.time_low);
net_nsid.time_mid := htons(net_nsid.time_mid); // net_nsid.time_mid := htons(net_nsid.time_mid);
net_nsid.time_hi_and_version := htons(net_nsid.time_hi_and_version); // net_nsid.time_hi_and_version := htons(net_nsid.time_hi_and_version);
{SHAInit(c, SHA_VERSION_1); {SHAInit(c, SHA_VERSION_1);
SHAUpdate(c, net_nsid, sizeof(net_nsid)); SHAUpdate(c, net_nsid, sizeof(net_nsid));
@ -221,7 +223,7 @@ begin
(* the hash is in network byte order at this point *) (* the hash is in network byte order at this point *)
format_uuid_v3or5(uuid, @hash, UUID_VERSION_5); format_uuid_v3or5(uuid, @hash, UUID_VERSION_5);
end; end;}
{ uuid_compare } { uuid_compare }
@ -281,9 +283,9 @@ procedure format_uuid_v3or5(var uuid: uuid_t; const hash: pointer; const v: inte
begin begin
(* convert UUID to local byte order *) (* convert UUID to local byte order *)
move(hash^, uuid, sizeof(uuid)); move(hash^, uuid, sizeof(uuid));
uuid.time_low := ntohl(uuid.time_low); // uuid.time_low := ntohl(uuid.time_low);
uuid.time_mid := ntohs(uuid.time_mid); // uuid.time_mid := ntohs(uuid.time_mid);
uuid.time_hi_and_version := ntohs(uuid.time_hi_and_version); // uuid.time_hi_and_version := ntohs(uuid.time_hi_and_version);
(* put in the variant and version bits *) (* put in the variant and version bits *)
uuid.time_hi_and_version := uuid.time_hi_and_version and $0FFF; uuid.time_hi_and_version := uuid.time_hi_and_version and $0FFF;
@ -348,4 +350,4 @@ begin
Result := Random($10000); Result := Random($10000);
end; end;
end. end.