FIoHash

Stores a BLAKE3-160 hash, taken from the first 20 bytes of a BLAKE3-256 hash.

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/IO/IoHash.h

Include

#include "IO/IoHash.h"

Syntax

struct FIoHash

Remarks

Stores a BLAKE3-160 hash, taken from the first 20 bytes of a BLAKE3-256 hash.

The BLAKE3 hash function was selected for its high performance and its ability to parallelize. Only the leading 160 bits of the 256-bit hash are used, to provide strong collision resistance while minimizing the size of the hash.

When the data to hash is not in a contiguous region of memory, use FIoHashBuilder to hash data in blocks with FIoHashBuilder::Update(Block) followed by FIoHashBuilder::Finalize().

Constructors

Name Description

Public function

FIoHash()

Construct a zero hash.

Public function

FIoHash

(
    const ByteArray& Hash
)

Construct a hash from an array of 20 bytes.

Public function

FIoHash

(
    FMemoryView Hash
)

Construct a hash from a view of 20 bytes.

Public function

FIoHash

(
    const FBlake3Hash& Hash
)

Construct a hash from a BLAKE3-256 hash.

Public function

FIoHash

(
    FAnsiStringView HexHash
)

Construct a hash from a 40-character hex string.

Public function

FIoHash

(
    FWideStringView HexHash
)

Construct a zero hash.

Public function

FIoHash

(
    FUtf8StringView HexHash
)

Construct a zero hash.

Functions

Name Description

Public function

ByteArray &

 

GetBytes()

Returns a reference to the raw byte array for the hash.

Public function Const

const ByteAr...

 

GetBytes()

Public function Static

FIoHash

 

HashBuffer

(
    FMemoryView View
)

Calculate the hash of the buffer.

Public function Static

FIoHash

 

HashBuffer

(
    const FCompositeBuffer& Buffer
)

Calculate the hash of the buffer.

Public function Static

FIoHash

 

HashBuffer

(
    const void* Data,
    uint64 Size
)

Calculate the hash of the buffer.

Public function Const

bool

 

IsZero()

Returns whether this is a zero hash.

Public function

void

 

Reset()

Reset this to a zero hash.

Typedefs

Name

Description

ByteArray

Constants

Name

Description

Zero

A zero hash.