Skip to content

rc_hash_generate_from_buffer

Jamiras edited this page Sep 7, 2020 · 3 revisions

Generates a RetroAchievements hash from a block of memory.

Syntax

int rc_hash_generate_from_buffer(
    char hash[33], 
    int console_id, 
    uint8_t* buffer, 
    size_t buffer_size
);

Parameters

hash

A buffer to write the calculated hash into. The resulting hash will be 32 characters long, plus a null terminator.

console_id

Specifies the console associated to the buffered data to be hashed.

For a list of known consoles, see rconsoles.h. Note that not all consoles identified in the enum currently have hashing support.

buffer

Pointer to the data to be hashed (usually an in-memory copy of the game file).

buffer_size

The number of bytes to hash.

Return value

If the function succeeds, the return value is non-zero and hash will be populated with the calculated hash.

If the function fails, the return value is zero. To capture the failure reason, register a handler with rc_hash_init_error_message_callback.

Remarks

This function is normally called when the game has already been loaded into memory for other reasons. If you want to generate a hash for a file without explicitly preloading it, see rc_hash_generate_from_file.

Additional details about the hashing process can be captured by rc_hash_init_verbose_message_callback.

Minimum version: 9.0.0

See also

rc_hash_generate_from_file

rc_hash_init_error_message_callback

rc_hash_init_verbose_message_callback

rc_hash_iterate

rcheevos

rc_client

Integration guide

client

user

game

processing

rc_client_raintegration

Integration guide

rc_runtime

rhash

rapi

common

user

runtime

info

Clone this wiki locally