System.Hash.THashSHA2.GetHashBytes

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class function GetHashBytes(const AData: string; AHashVersion: TSHA2Version = TSHA2Version.SHA256): TBytes; overload; static;
class function GetHashBytes(const AStream: TStream; AHashVersion: TSHA2Version = TSHA2Version.SHA256): TBytes; overload; static;

C++

static System::DynamicArray<System::Byte> __fastcall GetHashBytes(const System::UnicodeString AData, TSHA2Version AHashVersion = (TSHA2Version)(0x1))/* overload */;
static System::DynamicArray<System::Byte> __fastcall GetHashBytes(System::Classes::TStream* const AStream, TSHA2Version AHashVersion = (TSHA2Version)(0x1))/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.Hash.pas
System.Hash.hpp
System.Hash THashSHA2

Description

Creates a hash digest from the specified input value and returns the value of the created digest as bytes.

The optional parameter AHashVersion lets you specify the SHA2 variant for this hash. Default value is TSHA2Version.SHA256.

GetHashBytes accepts one of the following as the input value:

  • AData: A string.
  • AStream: A stream.

See Also