UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FSHA1 Class Reference

#include <SecureHash.h>

Public Types

enum  { DigestSize =20 }
 

Public Member Functions

CORE_API FSHA1 ()
 
CORE_API ~FSHA1 ()
 
CORE_API void Reset ()
 
CORE_API void Update (const uint8 *data, uint64 len)
 
CORE_API void UpdateWithString (const TCHAR *data, uint32 len)
 
template<typename Type UE_REQUIRES>
void Update (const Type &InData)
 
CORE_API void Final ()
 
FSHAHash Finalize ()
 
CORE_API void GetHash (uint8 *puDest) const
 

Static Public Member Functions

static CORE_API void HashBuffer (const void *Data, uint64 DataSize, uint8 *OutHash)
 
static FSHAHash HashBuffer (const void *Data, uint64 DataSize)
 
static CORE_API void HMACBuffer (const void *Key, uint32 KeySize, const void *Data, uint64 DataSize, uint8 *OutHash)
 
static CORE_API void InitializeFileHashesFromBuffer (uint8 *Buffer, uint64 BufferSize, bool bDuplicateKeyMemory=false)
 
static CORE_API bool GetFileSHAHash (const TCHAR *Pathname, uint8 Hash[20], bool bIsFullPackageHash=true)
 

Public Attributes

uint32 m_state [5]
 
uint64 m_count
 
uint32 __reserved1 [1]
 
uint8 m_buffer [64]
 
uint8 m_digest [20]
 
uint32 __reserved2 [3]
 

Member Enumeration Documentation

◆ anonymous enum

Enumerator
DigestSize 

Constructor & Destructor Documentation

◆ FSHA1()

FSHA1::FSHA1 ( )

◆ ~FSHA1()

FSHA1::~FSHA1 ( )

Member Function Documentation

◆ Final()

void FSHA1::Final ( )

◆ Finalize()

FSHAHash FSHA1::Finalize ( )
inline

◆ GetFileSHAHash()

bool FSHA1::GetFileSHAHash ( const TCHAR Pathname,
uint8  Hash[20],
bool  bIsFullPackageHash = true 
)
static

Gets the stored SHA hash from the platform, if it exists. This function must be able to be called from any thread.

Parameters
PathnamePathname to the file to get the SHA for
Hash20 byte array that receives the hash
bIsFullPackageHashtrue if we are looking for a full package hash, instead of a script code only hash
Returns
true if the hash was found, false otherwise

◆ GetHash()

void FSHA1::GetHash ( uint8 puDest) const

◆ HashBuffer() [1/2]

static FSHAHash FSHA1::HashBuffer ( const void Data,
uint64  DataSize 
)
inlinestatic

Calculate the hash on a single block and return it

Parameters
DataInput data to hash
DataSizeSize of the Data block
Returns
Resulting digest

◆ HashBuffer() [2/2]

void FSHA1::HashBuffer ( const void Data,
uint64  DataSize,
uint8 OutHash 
)
static

Calculate the hash on a single block and return it

Parameters
DataInput data to hash
DataSizeSize of the Data block
OutHashResulting hash value (20 byte buffer)

◆ HMACBuffer()

void FSHA1::HMACBuffer ( const void Key,
uint32  KeySize,
const void Data,
uint64  DataSize,
uint8 OutHash 
)
static

Generate the HMAC (Hash-based Message Authentication Code) for a block of data. https://en.wikipedia.org/wiki/Hash-based_message_authentication_code

Parameters
KeyThe secret key to be used when generating the HMAC
KeySizeThe size of the key
DataInput data to hash
DataSizeSize of the Data block
OutHashResulting hash value (20 byte buffer)

◆ InitializeFileHashesFromBuffer()

void FSHA1::InitializeFileHashesFromBuffer ( uint8 Buffer,
uint64  BufferSize,
bool  bDuplicateKeyMemory = false 
)
static

Shared hashes.sha reading code (each platform gets a buffer to the data, then passes it to this function for processing)

Parameters
BufferContents of hashes.sha (probably loaded from an a section in the executable)
BufferSizeSize of Buffer
bDuplicateKeyMemoryIf Buffer is not always loaded, pass true so that the 20 byte hashes are duplicated

Shared hashes.sha reading code (each platform gets a buffer to the data, then passes it to this function for processing)

◆ Reset()

void FSHA1::Reset ( )

◆ Update() [1/2]

template<typename Type UE_REQUIRES>
void FSHA1::Update ( const Type &  InData)
inline

◆ Update() [2/2]

void FSHA1::Update ( const uint8 data,
uint64  len 
)

◆ UpdateWithString()

void FSHA1::UpdateWithString ( const TCHAR data,
uint32  len 
)

Member Data Documentation

◆ __reserved1

uint32 FSHA1::__reserved1[1]

◆ __reserved2

uint32 FSHA1::__reserved2[3]

◆ m_buffer

uint8 FSHA1::m_buffer[64]

◆ m_count

uint64 FSHA1::m_count

◆ m_digest

uint8 FSHA1::m_digest[20]

◆ m_state

uint32 FSHA1::m_state[5]

The documentation for this class was generated from the following files: