* implemented uuid_create_sha1_from_name

* changed some var to out parameters (so that there's no not initialized warning)

git-svn-id: trunk@15153 -
This commit is contained in:
ivost 2010-04-19 12:18:18 +00:00
parent c3c1cfbb9f
commit c9e3480f44
4 changed files with 117 additions and 92 deletions

View File

@ -1,8 +1,8 @@
# #
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/12/10] # Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/04/16]
# #
default: all default: all
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
BSDs = freebsd netbsd openbsd darwin BSDs = freebsd netbsd openbsd darwin
UNIXs = linux $(BSDs) solaris qnx haiku UNIXs = linux $(BSDs) solaris qnx haiku
LIMIT83fs = go32v2 os2 emx watcom LIMIT83fs = go32v2 os2 emx watcom
@ -267,184 +267,187 @@ PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(F
override PACKAGE_NAME=hash override PACKAGE_NAME=hash
override PACKAGE_VERSION=2.5.1 override PACKAGE_VERSION=2.5.1
ifeq ($(FULL_TARGET),i386-linux) ifeq ($(FULL_TARGET),i386-linux)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 unixcrypt override TARGET_UNITS+=md5 crc ntlm sha1 uuid unixcrypt
endif endif
ifeq ($(FULL_TARGET),i386-go32v2) ifeq ($(FULL_TARGET),i386-go32v2)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-win32) ifeq ($(FULL_TARGET),i386-win32)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-os2) ifeq ($(FULL_TARGET),i386-os2)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-freebsd) ifeq ($(FULL_TARGET),i386-freebsd)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-beos) ifeq ($(FULL_TARGET),i386-beos)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-haiku) ifeq ($(FULL_TARGET),i386-haiku)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-netbsd) ifeq ($(FULL_TARGET),i386-netbsd)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-solaris) ifeq ($(FULL_TARGET),i386-solaris)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-qnx) ifeq ($(FULL_TARGET),i386-qnx)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-netware) ifeq ($(FULL_TARGET),i386-netware)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-openbsd) ifeq ($(FULL_TARGET),i386-openbsd)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-wdosx) ifeq ($(FULL_TARGET),i386-wdosx)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-darwin) ifeq ($(FULL_TARGET),i386-darwin)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-emx) ifeq ($(FULL_TARGET),i386-emx)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-watcom) ifeq ($(FULL_TARGET),i386-watcom)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-netwlibc) ifeq ($(FULL_TARGET),i386-netwlibc)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-wince) ifeq ($(FULL_TARGET),i386-wince)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-embedded) ifeq ($(FULL_TARGET),i386-embedded)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),i386-symbian) ifeq ($(FULL_TARGET),i386-symbian)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif
ifeq ($(FULL_TARGET),i386-nativent)
override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),m68k-linux) ifeq ($(FULL_TARGET),m68k-linux)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 unixcrypt override TARGET_UNITS+=md5 crc ntlm sha1 uuid unixcrypt
endif endif
ifeq ($(FULL_TARGET),m68k-freebsd) ifeq ($(FULL_TARGET),m68k-freebsd)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),m68k-netbsd) ifeq ($(FULL_TARGET),m68k-netbsd)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),m68k-amiga) ifeq ($(FULL_TARGET),m68k-amiga)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),m68k-atari) ifeq ($(FULL_TARGET),m68k-atari)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),m68k-openbsd) ifeq ($(FULL_TARGET),m68k-openbsd)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),m68k-palmos) ifeq ($(FULL_TARGET),m68k-palmos)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),m68k-embedded) ifeq ($(FULL_TARGET),m68k-embedded)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),powerpc-linux) ifeq ($(FULL_TARGET),powerpc-linux)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 unixcrypt override TARGET_UNITS+=md5 crc ntlm sha1 uuid unixcrypt
endif endif
ifeq ($(FULL_TARGET),powerpc-netbsd) ifeq ($(FULL_TARGET),powerpc-netbsd)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),powerpc-amiga) ifeq ($(FULL_TARGET),powerpc-amiga)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),powerpc-macos) ifeq ($(FULL_TARGET),powerpc-macos)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),powerpc-darwin) ifeq ($(FULL_TARGET),powerpc-darwin)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),powerpc-morphos) ifeq ($(FULL_TARGET),powerpc-morphos)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),powerpc-embedded) ifeq ($(FULL_TARGET),powerpc-embedded)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),sparc-linux) ifeq ($(FULL_TARGET),sparc-linux)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 unixcrypt override TARGET_UNITS+=md5 crc ntlm sha1 uuid unixcrypt
endif endif
ifeq ($(FULL_TARGET),sparc-netbsd) ifeq ($(FULL_TARGET),sparc-netbsd)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),sparc-solaris) ifeq ($(FULL_TARGET),sparc-solaris)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),sparc-embedded) ifeq ($(FULL_TARGET),sparc-embedded)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),x86_64-linux) ifeq ($(FULL_TARGET),x86_64-linux)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 unixcrypt override TARGET_UNITS+=md5 crc ntlm sha1 uuid unixcrypt
endif endif
ifeq ($(FULL_TARGET),x86_64-freebsd) ifeq ($(FULL_TARGET),x86_64-freebsd)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),x86_64-solaris) ifeq ($(FULL_TARGET),x86_64-solaris)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),x86_64-darwin) ifeq ($(FULL_TARGET),x86_64-darwin)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),x86_64-win64) ifeq ($(FULL_TARGET),x86_64-win64)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),x86_64-embedded) ifeq ($(FULL_TARGET),x86_64-embedded)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),arm-linux) ifeq ($(FULL_TARGET),arm-linux)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 unixcrypt override TARGET_UNITS+=md5 crc ntlm sha1 uuid unixcrypt
endif endif
ifeq ($(FULL_TARGET),arm-palmos) ifeq ($(FULL_TARGET),arm-palmos)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),arm-darwin) ifeq ($(FULL_TARGET),arm-darwin)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),arm-wince) ifeq ($(FULL_TARGET),arm-wince)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),arm-gba) ifeq ($(FULL_TARGET),arm-gba)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),arm-nds) ifeq ($(FULL_TARGET),arm-nds)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),arm-embedded) ifeq ($(FULL_TARGET),arm-embedded)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),arm-symbian) ifeq ($(FULL_TARGET),arm-symbian)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),powerpc64-linux) ifeq ($(FULL_TARGET),powerpc64-linux)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 unixcrypt override TARGET_UNITS+=md5 crc ntlm sha1 uuid unixcrypt
endif endif
ifeq ($(FULL_TARGET),powerpc64-darwin) ifeq ($(FULL_TARGET),powerpc64-darwin)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),powerpc64-embedded) ifeq ($(FULL_TARGET),powerpc64-embedded)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),avr-embedded) ifeq ($(FULL_TARGET),avr-embedded)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),armeb-linux) ifeq ($(FULL_TARGET),armeb-linux)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 unixcrypt override TARGET_UNITS+=md5 crc ntlm sha1 uuid unixcrypt
endif endif
ifeq ($(FULL_TARGET),armeb-embedded) ifeq ($(FULL_TARGET),armeb-embedded)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 override TARGET_UNITS+=md5 crc ntlm sha1 uuid
endif endif
ifeq ($(FULL_TARGET),mipsel-linux) ifeq ($(FULL_TARGET),mipsel-linux)
override TARGET_UNITS+=md5 crc ntlm uuid sha1 unixcrypt override TARGET_UNITS+=md5 crc ntlm sha1 uuid unixcrypt
endif endif
ifeq ($(FULL_TARGET),i386-linux) ifeq ($(FULL_TARGET),i386-linux)
override TARGET_EXAMPLEDIRS+=examples override TARGET_EXAMPLEDIRS+=examples
@ -506,6 +509,9 @@ endif
ifeq ($(FULL_TARGET),i386-symbian) ifeq ($(FULL_TARGET),i386-symbian)
override TARGET_EXAMPLEDIRS+=examples override TARGET_EXAMPLEDIRS+=examples
endif endif
ifeq ($(FULL_TARGET),i386-nativent)
override TARGET_EXAMPLEDIRS+=examples
endif
ifeq ($(FULL_TARGET),m68k-linux) ifeq ($(FULL_TARGET),m68k-linux)
override TARGET_EXAMPLEDIRS+=examples override TARGET_EXAMPLEDIRS+=examples
endif endif
@ -687,6 +693,9 @@ endif
ifeq ($(FULL_TARGET),i386-symbian) ifeq ($(FULL_TARGET),i386-symbian)
override COMPILER_SOURCEDIR+=src override COMPILER_SOURCEDIR+=src
endif endif
ifeq ($(FULL_TARGET),i386-nativent)
override COMPILER_SOURCEDIR+=src
endif
ifeq ($(FULL_TARGET),m68k-linux) ifeq ($(FULL_TARGET),m68k-linux)
override COMPILER_SOURCEDIR+=src override COMPILER_SOURCEDIR+=src
endif endif
@ -1149,6 +1158,10 @@ ifeq ($(OS_TARGET),symbian)
SHAREDLIBEXT=.dll SHAREDLIBEXT=.dll
SHORTSUFFIX=symbian SHORTSUFFIX=symbian
endif endif
ifeq ($(OS_TARGET),NativeNT)
SHAREDLIBEXT=.dll
SHORTSUFFIX=nativent
endif
else else
ifeq ($(OS_TARGET),go32v1) ifeq ($(OS_TARGET),go32v1)
PPUEXT=.pp1 PPUEXT=.pp1
@ -1634,6 +1647,9 @@ endif
ifeq ($(FULL_TARGET),i386-symbian) ifeq ($(FULL_TARGET),i386-symbian)
REQUIRE_PACKAGES_RTL=1 REQUIRE_PACKAGES_RTL=1
endif endif
ifeq ($(FULL_TARGET),i386-nativent)
REQUIRE_PACKAGES_RTL=1
endif
ifeq ($(FULL_TARGET),m68k-linux) ifeq ($(FULL_TARGET),m68k-linux)
REQUIRE_PACKAGES_RTL=1 REQUIRE_PACKAGES_RTL=1
endif endif
@ -2198,6 +2214,9 @@ fpc_zipdistinstall:
ifdef EXEFILES ifdef EXEFILES
override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES)) override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
endif endif
ifdef CLEAN_PROGRAMS
override CLEANEXEFILES+=$(addprefix $(TARGETDIRPREFIX),$(addsuffix $(EXEEXT), $(CLEAN_PROGRAMS)))
endif
ifdef CLEAN_UNITS ifdef CLEAN_UNITS
override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS)) override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
endif endif
@ -2244,6 +2263,9 @@ endif
ifdef CLEANRSTFILES ifdef CLEANRSTFILES
-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES)) -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
endif endif
endif
ifdef CLEAN_FILES
-$(DEL) $(CLEAN_FILES)
endif endif
-$(DELTREE) units -$(DELTREE) units
-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT) -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
@ -2427,6 +2449,9 @@ endif
ifeq ($(FULL_TARGET),i386-symbian) ifeq ($(FULL_TARGET),i386-symbian)
TARGET_EXAMPLEDIRS_EXAMPLES=1 TARGET_EXAMPLEDIRS_EXAMPLES=1
endif endif
ifeq ($(FULL_TARGET),i386-nativent)
TARGET_EXAMPLEDIRS_EXAMPLES=1
endif
ifeq ($(FULL_TARGET),m68k-linux) ifeq ($(FULL_TARGET),m68k-linux)
TARGET_EXAMPLEDIRS_EXAMPLES=1 TARGET_EXAMPLEDIRS_EXAMPLES=1
endif endif

View File

@ -7,7 +7,7 @@ name=hash
version=2.5.1 version=2.5.1
[target] [target]
units=md5 crc ntlm uuid sha1 units=md5 crc ntlm sha1 uuid
units_linux=unixcrypt units_linux=unixcrypt
exampledirs=examples exampledirs=examples

View File

@ -29,9 +29,9 @@ type
end; end;
{ core } { core }
procedure SHA1Init(var ctx: TSHA1Context); procedure SHA1Init(out ctx: TSHA1Context);
procedure SHA1Update(var ctx: TSHA1Context; const Buf; BufLen: PtrUInt); procedure SHA1Update(var ctx: TSHA1Context; const Buf; BufLen: PtrUInt);
procedure SHA1Final(var ctx: TSHA1Context; var Digest: TSHA1Digest); procedure SHA1Final(var ctx: TSHA1Context; out Digest: TSHA1Digest);
{ auxiliary } { auxiliary }
function SHA1String(const S: String): TSHA1Digest; function SHA1String(const S: String): TSHA1Digest;
@ -61,7 +61,7 @@ begin
end; end;
end; end;
procedure SHA1Init(var ctx: TSHA1Context); procedure SHA1Init(out ctx: TSHA1Context);
begin begin
FillChar(ctx, sizeof(TSHA1Context), 0); FillChar(ctx, sizeof(TSHA1Context), 0);
ctx.State[0] := $67452301; ctx.State[0] := $67452301;
@ -201,7 +201,7 @@ const
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
); );
procedure SHA1Final(var ctx: TSHA1Context; var Digest: TSHA1Digest); procedure SHA1Final(var ctx: TSHA1Context; out Digest: TSHA1Digest);
var var
Length: QWord; Length: QWord;
Pads: Cardinal; Pads: Cardinal;

View File

@ -21,7 +21,7 @@ interface
{$h+} {$h+}
uses uses
SysUtils, DateUtils, md5; SysUtils, DateUtils, md5, sha1;
@ -87,16 +87,16 @@ const
procedure uuid_initialize(const state: uuid_state); procedure uuid_initialize(const state: uuid_state);
{ uuid_create -- generator a UUID } { uuid_create -- generator a UUID }
function uuid_create(var uuid: uuid_t): boolean; function uuid_create(out uuid: uuid_t): boolean;
{ uuid_finalize -- returns the current state } { uuid_finalize -- returns the current state }
procedure uuid_finalize(var state: uuid_state); procedure uuid_finalize(out state: uuid_state);
{ uuid_create_md5_from_name -- create a version 3 (MD5) UUID using a "name" from a "name space" } { uuid_create_md5_from_name -- create a version 3 (MD5) UUID using a "name" from a "name space" }
procedure uuid_create_md5_from_name(var uuid: uuid_t; const nsid: uuid_t; const name: string); procedure uuid_create_md5_from_name(out uuid: uuid_t; const nsid: uuid_t; const name: string);
{ uuid_create_sha1_from_name -- create a version 5 (SHA-1) UUID using a "name" from a "name space" } { uuid_create_sha1_from_name -- create a version 5 (SHA-1) UUID using a "name" from a "name space" }
procedure uuid_create_sha1_from_name(var uuid: uuid_t; const nsid: uuid_t; const name: string); procedure uuid_create_sha1_from_name(out uuid: uuid_t; const nsid: uuid_t; const name: string);
{ uuid_compare -- Compare two UUID's "lexically" } { uuid_compare -- Compare two UUID's "lexically" }
function uuid_compare(const u1, u2: uuid_t): integer; function uuid_compare(const u1, u2: uuid_t): integer;
@ -108,19 +108,19 @@ function uuid_compare(const u1, u2: uuid_t): integer;
******************************************************************************) ******************************************************************************)
{ read_state -- read UUID generator state from non-volatile store } { read_state -- read UUID generator state from non-volatile store }
function read_state(var clockseq: unsigned16; var timestamp: uuid_time_t; var node: uuid_node_t): boolean; function read_state(out clockseq: unsigned16; out timestamp: uuid_time_t; out node: uuid_node_t): boolean;
{ write_state -- save UUID generator state back to non-volatile storage } { write_state -- save UUID generator state back to non-volatile storage }
procedure write_state(var clockseq: unsigned16; const timestamp: uuid_time_t; const node: uuid_node_t); procedure write_state(var clockseq: unsigned16; const timestamp: uuid_time_t; const node: uuid_node_t);
{ format_uuid_v1 -- make a UUID from the timestamp, clockseq, and node ID } { format_uuid_v1 -- make a UUID from the timestamp, clockseq, and node ID }
procedure format_uuid_v1(var uuid: uuid_t; const clockseq: unsigned16; const timestamp: uuid_time_t; const node: uuid_node_t); procedure format_uuid_v1(out uuid: uuid_t; const clockseq: unsigned16; const timestamp: uuid_time_t; const node: uuid_node_t);
{ format_uuid_v3or5 -- make a UUID from a (pseudo)random 128-bit number } { format_uuid_v3or5 -- make a UUID from a (pseudo)random 128-bit number }
procedure format_uuid_v3or5(var uuid: uuid_t; const hash: pointer; const v: integer); procedure format_uuid_v3or5(out uuid: uuid_t; const hash: pointer; const v: integer);
{ get_current_time -- get time as 60-bit 100ns ticks since UUID epoch. Compensate for the fact that real clock resolution is less than 100ns. } { get_current_time -- get time as 60-bit 100ns ticks since UUID epoch. Compensate for the fact that real clock resolution is less than 100ns. }
procedure get_current_time(var timestamp: uuid_time_t); procedure get_current_time(out timestamp: uuid_time_t);
@ -129,7 +129,7 @@ procedure get_current_time(var timestamp: uuid_time_t);
******************************************************************************) ******************************************************************************)
{ get_system_time -- system dependent call to get the current system time. Returned as 100ns ticks since UUID epoch, but resolution may be less than 100ns. } { get_system_time -- system dependent call to get the current system time. Returned as 100ns ticks since UUID epoch, but resolution may be less than 100ns. }
procedure get_system_time(var timestamp: uuid_time_t); procedure get_system_time(out timestamp: uuid_time_t);
{ true_random -- generate a crypto-quality random number. } { true_random -- generate a crypto-quality random number. }
function true_random: unsigned16; function true_random: unsigned16;
@ -158,7 +158,7 @@ end;
{ uuid_finalize } { uuid_finalize }
procedure uuid_finalize(var state: uuid_state); procedure uuid_finalize(out state: uuid_state);
begin begin
state := current_state; state := current_state;
end; end;
@ -166,7 +166,7 @@ end;
{ uuid_create } { uuid_create }
function uuid_create(var uuid: uuid_t): boolean; function uuid_create(out uuid: uuid_t): boolean;
var var
timestamp: uuid_time_t; timestamp: uuid_time_t;
last_time: uuid_time_t; last_time: uuid_time_t;
@ -202,7 +202,7 @@ end;
{ uuid_create_md5_from_name } { uuid_create_md5_from_name }
procedure uuid_create_md5_from_name(var uuid: uuid_t; const nsid: uuid_t; const name: string); procedure uuid_create_md5_from_name(out uuid: uuid_t; const nsid: uuid_t; const name: string);
var var
net_nsid: uuid_t; net_nsid: uuid_t;
c: TMDContext; c: TMDContext;
@ -227,11 +227,11 @@ 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(out uuid: uuid_t; const nsid: uuid_t; const name: string);
var var
net_nsid: uuid_t; net_nsid: uuid_t;
{ c: TMDContext; c: TSHA1Context;
hash: TMDDigest;} hash: TSHA1Digest;
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 *)
@ -240,10 +240,10 @@ begin
net_nsid.time_mid := ntobe(net_nsid.time_mid); net_nsid.time_mid := ntobe(net_nsid.time_mid);
net_nsid.time_hi_and_version := ntobe(net_nsid.time_hi_and_version); net_nsid.time_hi_and_version := ntobe(net_nsid.time_hi_and_version);
{SHAInit(c, SHA_VERSION_1); SHA1Init(c);
SHAUpdate(c, net_nsid, sizeof(net_nsid)); SHA1Update(c, net_nsid, sizeof(net_nsid));
SHAUpdate(c, pchar(name)^, Length(name)); SHA1Update(c, pchar(name)^, Length(name));
SHAFinal(c, hash);} SHA1Final(c, hash);
(* 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);
@ -266,7 +266,7 @@ end;
{ read_state } { read_state }
function read_state(var clockseq: unsigned16; var timestamp: uuid_time_t; var node: uuid_node_t): boolean; function read_state(out clockseq: unsigned16; out timestamp: uuid_time_t; out node: uuid_node_t): boolean;
begin begin
clockseq := current_state.cs; clockseq := current_state.cs;
timestamp := current_state.ts; timestamp := current_state.ts;
@ -288,7 +288,7 @@ end;
{ format_uuid_v1 } { format_uuid_v1 }
procedure format_uuid_v1(var uuid: uuid_t; const clockseq: unsigned16; const timestamp: uuid_time_t; const node: uuid_node_t); procedure format_uuid_v1(out uuid: uuid_t; const clockseq: unsigned16; const timestamp: uuid_time_t; const node: uuid_node_t);
begin begin
uuid.time_low := timestamp and $FFFFFFFF; uuid.time_low := timestamp and $FFFFFFFF;
uuid.time_mid := (timestamp shr 32) and $FFFF; uuid.time_mid := (timestamp shr 32) and $FFFF;
@ -303,7 +303,7 @@ end;
{ format_uuid_v3or5 } { format_uuid_v3or5 }
procedure format_uuid_v3or5(var uuid: uuid_t; const hash: pointer; const v: integer); procedure format_uuid_v3or5(out uuid: uuid_t; const hash: pointer; const v: integer);
begin begin
(* convert UUID to local byte order *) (* convert UUID to local byte order *)
move(hash^, uuid, sizeof(uuid)); move(hash^, uuid, sizeof(uuid));
@ -325,7 +325,7 @@ var
time_last: uuid_time_t; time_last: uuid_time_t;
uuids_this_tick: unsigned16 = UUIDS_PER_TICK; uuids_this_tick: unsigned16 = UUIDS_PER_TICK;
procedure get_current_time(var timestamp: uuid_time_t); procedure get_current_time(out timestamp: uuid_time_t);
var var
time_now: uuid_time_t; time_now: uuid_time_t;
begin begin
@ -358,7 +358,7 @@ end;
{ get_system_time } { get_system_time }
procedure get_system_time(var timestamp: uuid_time_t); procedure get_system_time(out timestamp: uuid_time_t);
var var
Epoch:TDateTime; Epoch:TDateTime;
begin begin