Skip to content

rc_hash_generate_from_file

Jamiras edited this page Sep 7, 2020 · 2 revisions

Generates a RetroAchievements hash from a file.

Syntax

int rc_hash_generate_from_file(
    char hash[33], 
    int console_id, 
    const char* path
);

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 file 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.

path

The path to the file to be hashed.

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

If the file has already been loaded into memory, consider using rc_hash_generate_from_buffer instead.

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_buffer

rc_hash_init_error_message_callback

rc_hash_init_verbose_message_callback

rc_hash_init_custom_filereader

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