e-CryptIt Engine Xojo Plugin |
|
SHA_384 Class (console safe)
SHA_384 is a message digest/hash algorithm with a digest/hash size of 384 bits (48 characters).
This algorithm has been tested against official test vectors.
Object
SHA_384
class SHA_384 implements
IHashAlgorithm
Methods
Final | Use this function when you are done adding bytes to the SHA_384 class.
|
shared Hash | Convenience shared function to hash small data with just one line of code without creating instance of the class. |
Update | Use this method to add data with MemoryBlock to the SHA_384 stream. |
Update | Use this method to add data with String to the SHA_384 stream. |
Constants
Version = 16.12 | |
Test case for a known test vector
Dim data as String
Dim hash as SHA_384
Dim result as String
Dim hexResult as String
Dim i as Integer
data = "abc"
data = ConvertEncoding(data,Encodings.ASCII)
hash = new SHA_384()
hash.Update(data)
result = hash.Final()
For i = 1 to 48
hexResult = hexResult + Right("0"+Hex(Asc(Mid(result,i,1))),2)
next
if hexResult <> Uppercase("cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7") then
return false
end if
data = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
data = ConvertEncoding(data,Encodings.ASCII)
hash = new SHA_384()
hash.Update(data)
result = hash.Final()
hexResult = ""
For i = 1 to 48
hexResult = hexResult + Right("0"+Hex(Asc(Mid(result,i,1))),2)
next
if hexResult = Uppercase("3391fdddfc8dc7393707a65b1b4709397cf8b1d162af05abfe8f450de5f36bc6b0455a8520bc4e6f5fe95b1fe3c8452b") then
return true
else
return false
end if
Supported Platforms:
macOS Intel 64 bitmacOS Apple SiliconWindows 32 bitWindows 64 bitWindows ARM 64 bitLinux 32 bitLinux 64 bitLinux ARM 32 bitLinux ARM 64 bitiOS