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

#include <BuildPatchHash.h>

Public Member Functions

 FRollingHash (uint32 WindowSize)
 
void ConsumeByte (const uint8 &NewByte)
 
void ConsumeBytes (const uint8 *NewBytes, const uint32 &NumBytes)
 
void RollForward (const uint8 &NewByte)
 
void Clear ()
 
const uint64 GetWindowHash () const
 
const HashRingBufferGetWindowData () const
 
const uint32 GetNumDataNeeded () const
 
const uint32 GetWindowSize () const
 

Static Public Member Functions

static uint64 GetHashForDataSet (const uint8 *DataSet, uint32 WindowSize)
 

Detailed Description

A class that performs a rolling hash

Constructor & Destructor Documentation

◆ FRollingHash()

FRollingHash::FRollingHash ( uint32  WindowSize)

Constructor

Member Function Documentation

◆ Clear()

void FRollingHash::Clear ( )

Clears all data ready for a new entire data set

◆ ConsumeByte()

void FRollingHash::ConsumeByte ( const uint8 NewByte)

Pass this function the initial data set to start the Rolling Hash with.

Parameters
NewByteThe byte to add to the hash state

◆ ConsumeBytes()

void FRollingHash::ConsumeBytes ( const uint8 NewBytes,
const uint32 NumBytes 
)

Helper to consume from a byte array

Parameters
NewBytesThe byte array
NumBytesThe number of bytes to consume

◆ GetHashForDataSet()

uint64 FRollingHash::GetHashForDataSet ( const uint8 DataSet,
uint32  WindowSize 
)
static

Static function to simply return the hash for a given data range.

Parameters
DataSetThe buffer to the data.
WindowSizeThe buffer of length.
Returns
The hash state for the provided data

◆ GetNumDataNeeded()

const uint32 FRollingHash::GetNumDataNeeded ( ) const

Get how many DataValueType values we still need to consume until our window is full

Returns
The number of DataValueType we still need

◆ GetWindowData()

const TRingBuffer< uint8 > & FRollingHash::GetWindowData ( ) const

Get the Ring Buffer for the current window

Returns
The ring buffer

◆ GetWindowHash()

const uint64 FRollingHash::GetWindowHash ( ) const

Get the HashState for the current window

Returns
The hash state

◆ GetWindowSize()

const uint32 FRollingHash::GetWindowSize ( ) const
Returns
the size of our window

◆ RollForward()

void FRollingHash::RollForward ( const uint8 NewByte)

Rolls the window by one byte forwards.

Parameters
NewByteThe byte that will be added to the front of the window

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