mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
ADD: BLAKE3 hash function (portable)
This commit is contained in:
parent
75807a3ee9
commit
fdbc1370e9
1 changed files with 9 additions and 8 deletions
|
|
@ -32,24 +32,24 @@ uses
|
|||
|
||||
type
|
||||
THashContext = TDCP_hash;
|
||||
THashAlgorithm = (HASH_BLAKE2S, HASH_BLAKE2SP, HASH_BLAKE2B, HASH_BLAKE2BP, HASH_CRC32,
|
||||
HASH_HAVAL, HASH_MD4, HASH_MD5, HASH_RIPEMD128, HASH_RIPEMD160, HASH_SFV,
|
||||
HASH_SHA1, HASH_SHA224, HASH_SHA256, HASH_SHA384, HASH_SHA512,
|
||||
THashAlgorithm = (HASH_BLAKE2S, HASH_BLAKE2SP, HASH_BLAKE2B, HASH_BLAKE2BP, HASH_BLAKE3,
|
||||
HASH_CRC32, HASH_HAVAL, HASH_MD4, HASH_MD5, HASH_RIPEMD128, HASH_RIPEMD160,
|
||||
HASH_SFV, HASH_SHA1, HASH_SHA224, HASH_SHA256, HASH_SHA384, HASH_SHA512,
|
||||
HASH_SHA3_224, HASH_SHA3_256, HASH_SHA3_384, HASH_SHA3_512, HASH_TIGER,
|
||||
HASH_BEST
|
||||
);
|
||||
|
||||
var
|
||||
HashFileExt: array[Low(THashAlgorithm)..Pred(High(THashAlgorithm))] of String = (
|
||||
'blake2s', 'blake2sp', 'blake2b', 'blake2bp', 'crc32', 'haval', 'md4',
|
||||
'md5', 'ripemd128', 'ripemd160', 'sfv', 'sha', 'sha224', 'sha256',
|
||||
'blake2s', 'blake2sp', 'blake2b', 'blake2bp', 'blake3', 'crc32', 'haval',
|
||||
'md4', 'md5', 'ripemd128', 'ripemd160', 'sfv', 'sha', 'sha224', 'sha256',
|
||||
'sha384', 'sha512', 'sha3', 'sha3', 'sha3', 'sha3', 'tiger'
|
||||
);
|
||||
|
||||
var
|
||||
HashName: array[Low(THashAlgorithm)..Pred(High(THashAlgorithm))] of String = (
|
||||
'blake2s', 'blake2sp', 'blake2b', 'blake2bp', 'crc32', 'haval', 'md4',
|
||||
'md5', 'ripemd128', 'ripemd160', 'sfv', 'sha1_160', 'sha2_224',
|
||||
'blake2s', 'blake2sp', 'blake2b', 'blake2bp', 'blake3', 'crc32', 'haval',
|
||||
'md4', 'md5', 'ripemd128', 'ripemd160', 'sfv', 'sha1_160', 'sha2_224',
|
||||
'sha2_256', 'sha2_384', 'sha2_512', 'sha3_224', 'sha3_256',
|
||||
'sha3_384', 'sha3_512', 'tiger'
|
||||
);
|
||||
|
|
@ -68,7 +68,7 @@ implementation
|
|||
|
||||
uses
|
||||
LazUTF8, DCPhaval, DCPmd4, DCPmd5, DCPripemd128, DCPripemd160, DCPcrc32,
|
||||
DCPsha1, DCPsha256, DCPsha512, DCPtiger, DCPblake2, DCPsha3;
|
||||
DCPsha1, DCPsha256, DCPsha512, DCPtiger, DCPblake2, DCPblake3, DCPsha3;
|
||||
|
||||
procedure HashInit(out Context: THashContext; Algorithm: THashAlgorithm);
|
||||
begin
|
||||
|
|
@ -86,6 +86,7 @@ begin
|
|||
HASH_BLAKE2SP: Context:= TDCP_blake2sp.Create(nil);
|
||||
HASH_BLAKE2B: Context:= TDCP_blake2b.Create(nil);
|
||||
HASH_BLAKE2BP: Context:= TDCP_blake2bp.Create(nil);
|
||||
HASH_BLAKE3: Context:= TDCP_blake3.Create(nil);
|
||||
HASH_CRC32: Context:= TDCP_crc32.Create(nil);
|
||||
HASH_HAVAL: Context:= TDCP_haval.Create(nil);
|
||||
HASH_MD4: Context:= TDCP_md4.Create(nil);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue