RetroAchievementsSharp 1.1.1

dotnet add package RetroAchievementsSharp --version 1.1.1
                    
NuGet\Install-Package RetroAchievementsSharp -Version 1.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RetroAchievementsSharp" Version="1.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RetroAchievementsSharp" Version="1.1.1" />
                    
Directory.Packages.props
<PackageReference Include="RetroAchievementsSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RetroAchievementsSharp --version 1.1.1
                    
#r "nuget: RetroAchievementsSharp, 1.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RetroAchievementsSharp@1.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RetroAchievementsSharp&version=1.1.1
                    
Install as a Cake Addin
#tool nuget:?package=RetroAchievementsSharp&version=1.1.1
                    
Install as a Cake Tool

RetroAchievementsSharp

NuGet NuGet downloads CLI tool winget CI .NET Platforms GitHub release License: GPL-2.0-or-later Docs Security policy Repo

A native C# port of the RAHasher hashing engine (rcheevos 40d916d → 12.5.0, RAHasher 1.8.4) that produces 100% identical hashes to the original for every supported console — the same hashes the RetroAchievements website and its clients use to identify ROMs and disc images.

  • Library — RetroAchievementsSharp (NuGet), targets net10.0 and net11.0; GPL-2.0-or-later.
  • CLI — RetroAchievementsSharp.exe, byte-identical in behavior to RAHasher 1.8.4, plus convenience subcommands (scan, identify, consoles, checkkeys, fetch-db). Install with winget on Windows or as the RetroAchievementsSharp.Cli .NET tool on any OS.
  • Verified — 439/439 fast tests + 172/172 slow (parity, real-ROM, RVZ, published-DB) green on each supported TFM, including a parity harness against source-built C oracles, RVZ-vs-ISO equality on real GameCube/Wii discs, and spot checks against the published RetroAchievements game database.
  • 1.1.1 highlights — .NET 10/11 with CHDSharp 1.7.1, the RetroAchievementsSharp.Cli .NET tool, winget packaging, and release automation. See WHATS_NEW.md.

Installation

Library

dotnet add package RetroAchievementsSharp

CLI

# Windows Package Manager
winget install PureLogicCode.RetroAchievementsSharp

# or, on any OS with .NET 10+
dotnet tool install --global RetroAchievementsSharp.Cli
retroachievementssharp NES game.nes

Works with the .NET 10 and 11 SDKs/runtimes on Windows, Linux, macOS, x64 and arm64. The release CLI bundles the .NET 11 runtime, so end users do not need .NET installed.

CLI downloads

Platform Architectures Formats
Windows x64, arm64 .zip
Linux x64, arm64 .deb, .rpm, .tar.gz
macOS x64, arm64 .dmg, .tar.gz

Every archive/package contains LICENSE, THIRD-PARTY-NOTICES.md, and README.md alongside the self-contained RetroAchievementsSharp executable.

Using the library

Requires .NET 10 or 11 (older runtimes are not supported). Add the package:

dotnet add package RetroAchievementsSharp

All API entry points live in the RetroAchievementsSharp namespace; every hash is a 32-character lowercase hex string that matches the hash published on retroachievements.org for the same file.

Hash a ROM file

using RetroAchievementsSharp;

if (RcHash.GenerateFromFile(out string hash, ConsoleIds.RcConsoleNintendo, "game.nes"))
    Console.WriteLine(hash); // e.g. "a3f5c0f8e1b2d9a4c7d6e5f4a3b2c1d0"

GenerateFromFile returns true when the file hashed successfully. The ConsoleIds constants cover every supported console (RcConsoleGameboy, RcConsoleMegaDrive, RcConsolePlaystation, …).

Hash in-memory data

byte[] data = File.ReadAllBytes("rom.bin");
if (RcHash.GenerateFromBuffer(out string hash, ConsoleIds.RcConsoleGameboy, data, data.Length))
    Console.WriteLine(hash);

Auto-detect the console (? mode)

When you don't know the console, use the iterator API — it tries every console's handler in the engine's exact table order and returns the first match:

var iterator = new RcHashIterator();
HashIterator.InitializeIterator(iterator, "Super Mario (USA).sfc", null, 0);
while (HashIterator.Iterate(out string hash, iterator) != 0)
    Console.WriteLine(hash); // the first hash that matched a console
HashIterator.DestroyIterator(iterator);

A single file can produce several hashes (e.g. a multi-disc .m3u), which is why Iterate is a loop.

Disc images (.cue, .iso, .gdi, .chd, .rvz, .wia)

Discs hash directly — no conversion needed. CHD is read via CHDSharp; GameCube/Wii RVZ/WIA images are decoded live via RVZSharp:

if (RcHash.GenerateFromFile(out string hash, ConsoleIds.RcConsolePlaystation, "disc.cue"))
    Console.WriteLine(hash);

if (RcHash.GenerateFromFile(out hash, ConsoleIds.RcConsoleGamecube, "game.rvz"))
    Console.WriteLine(hash);

if (RcHash.GenerateFromFile(out hash, ConsoleIds.RcConsoleWii, "game.chd"))
    Console.WriteLine(hash);

3DS .cia / .3ds (key files required)

Call Hash3Ds.InitHash3Ds(systemDir) once with a directory containing aes_keys.txt (and optionally seeddb.bin for seed-encrypted titles):

Hash3Ds.InitHash3Ds(@"C:\RetroArch\system");
if (RcHash.GenerateFromFile(out string hash, ConsoleIds.RcConsoleNintendo3Ds, "game.cia"))
    Console.WriteLine(hash);

Error handling

  • GenerateFromFile / GenerateFromBuffer return false (never throw) on unsupported files, missing 3DS keys, or hashing failures.
  • The engine reports errors through the message callbacks (see RcHash.InitErrorMessageCallback) — the CLI wires these to Serilog.
  • HashIterator.Iterate returns 0 when no console accepted the file.

Notes

  • Global configuration is process-wide — Hash3Ds.InitHash3Ds and the custom filereader/cdreader registrations (RcHash.InitCustomFilereader, RcHash.InitCustomCdreader) are global state, matching the C engine. Initialize once at startup; concurrent hashing from multiple threads is not supported.
  • Full API reference: https://purelogiccode.github.io/RetroAchievementsSharp/reference/public-api/. For exact engine behavior (64 MiB cap, header-stripping rules, track selection, verbose messages), see the documentation and known quirks.

Supported formats

Raw ROMs (all cartridge consoles), .zip (pre-loaded ROM, Arduboy FX, DOSZ/Zip64/DOSC), .m3u playlists, discs (.cue/.bin/.iso/.gdi/.chd including differential CHDs with a parent, GameCube/Wii .rvz/.wia), PS3 .iso/.chd, extracted disc folders and PKG layouts, 3DS .cia/.3ds/.3dsx (keys via -s / Hash3Ds.InitHash3Ds), and Neo Geo .neo carts. Console list: NES/Famicom, SNES/SFC, N64, GB/GBC/GBA, Master System, Mega Drive/Genesis, Game Gear, 32X, SG-1000, PCE/TG-16, PCE-CD, Saturn, Sega CD, Dreamcast, PS1, PS2, PSP, PS3, 3DO, PC-FX, Jaguar(+CD), Neo Geo Pocket(+Color), Neo Geo CD, NDS/DSi/3DS — the full rcheevos console table (~59 consoles), including classic microcomputers.

CLI usage

Identical to RAHasher 1.8.4:

RetroAchievementsSharp [-v] [-s systempath] system filepath...
  • -v — verbose messages for debugging
  • -s systempath — directory with aes_keys.txt / seeddb.bin (3DS)
  • system — console key (case-insensitive) or numeric id; ? auto-detects by trying every console
  • filepath — file(s) to hash; may contain wildcards in the filename; multiple files hash each in turn

Examples:

RetroAchievementsSharp NES game.nes
RetroAchievementsSharp PS1 disc.cue
RetroAchievementsSharp -s C:\RetroArch\system 3DS game.cia

Supported input formats: raw ROMs, .zip (pre-loaded ROM / Arduboy FX / DOSZ), .m3u playlists, .cue/.bin/.iso/.gdi discs, .chd discs, 3DS .cia/.3ds/.3dsx (keys required via -s), and .neo Neo Geo carts (Geolith format, hashed by ROM content). Exit codes: 0 success, 1 any failure.

Quirk faithfully reproduced from the original: console keys are only accepted for consoles with a non-empty RA group; NULL-group consoles (Oric, TI83, TIC-80, ESCV, DOS, 3DS, …) must be addressed by numeric id — e.g. RetroAchievementsSharp 62 game.cia. (The C's find_console_id falls back to atoi, so the key 3DS would silently resolve to console 3!)

RetroAchievementsSharp scan — hash a whole ROM library

(not present in RAHasher 1.8.3 — the legacy positional interface above is unchanged) hashes each file with per-file console auto-detection and emits one manifest row per file:

RetroAchievementsSharp scan [options] <path>...
  -f, --format <text|csv|json>  output format (default: text)
  -c, --console <key|id>        hash every file as this console instead of
                                auto-detecting (zip pre-load, CHD/RVZ, 3DS keys)
  -o, --out <file>              write the manifest to this file (atomically)
                                instead of stdout
  -s <systempath>               supplementary files directory (3DS keys)
      --match <db.json>         RetroAchievements database snapshot
      --move <dir>              move matched files into <dir>/<console-key>/
      --dry-run                 preview --move without moving anything
      --no-recursive            do not descend into subdirectories
  -h, --help                    show help

By default each file is auto-detected the same way the ? system key works for a single file; --console forces a specific console for every file (handy for per-system ROM folders, e.g. RetroAchievementsSharp scan -c PS1 -f json -o hashes.json C:\Roms\PSX). Matched rows append => <Title> (ID <id>). The manifest goes to stdout (or the --out file), the summary (Scanned N file(s): X hashed, Y failed) to stderr; exit code 0 when every file hashed, 1 when any failed. JSON rows carry file (display path), path (full path), console, consoleId, and hash.

Other subcommands

  • RetroAchievementsSharp consoles [--format text|csv|json] — dump the console table.
  • RetroAchievementsSharp checkkeys [-s <systempath>] — validate 3DS key files.
  • RetroAchievementsSharp identify <system> <file> [--db <RetroAchievements.json> | --user <u> --api-key <k>] — hash one file and resolve it to a game with achievements (local snapshot or live API).
  • RetroAchievementsSharp fetch-db <url-or-path> [--out <file>] — download a database snapshot, validate it, save atomically.

Full details for every subcommand: docs/getting-started/usage.md.

Building

dotnet build RetroAchievementsSharp.sln -c Release

Requires the .NET 11 SDK (see global.json). All three projects multi-target net10.0;net11.0; the library package is compatible with .NET 10 and 11. Build a single target with -f net10.0 (faster).

Publishing the CLI

The release bundles are self-contained single-file executables with the .NET 11 runtime bundled (no runtime install needed on the target):

Platform Architectures Formats
Windows x64, arm64 .zip
Linux x64, arm64 .deb, .rpm, .tar.gz
macOS x64, arm64 .dmg, .tar.gz

Build locally on Windows:

./scripts/build-release.ps1 -Version 1.1.1

Bundles are written to RetroAchievementsSharp/bin/Release/ and existing files there are never deleted. Full CI/release details: docs/getting-started/publishing.md.

Manual publish example:

dotnet publish RetroAchievementsSharp.Cli -c Release -f net11.0 -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -o artifacts/win-x64

The published apphost is RetroAchievementsSharp.Cli.exe; release scripts copy it to RetroAchievementsSharp.exe (and to RetroAchievementsSharp on Linux/macOS). (The parity suite's oracle is a Windows PE, so Tier-2 parity runs on Windows; on Linux the parity cases skip and the ported vectors still run.)

Packaging the NuGet library

dotnet pack RetroAchievementsSharp -c Release
# publishes RetroAchievementsSharp.1.1.1.nupkg + .snupkg (default: bin/Release); make artifacts/:
dotnet pack RetroAchievementsSharp -c Release -o artifacts

# the CLI .NET tool (net10.0/net11.0, command: retroachievementssharp)
dotnet pack RetroAchievementsSharp.Cli -c Release -o artifacts

The package includes the net10/11 assemblies, XML docs, the GPL-2.0-or-later license and third-party notices, SourceLink/symbols, and runs NuGet package validation on every pack. The release workflow publishes the library, the RetroAchievementsSharp.Cli .NET tool, and symbols to NuGet.org automatically on every v* tag (using the NUGET_API_KEY Actions secret). Manual push if needed:

dotnet nuget push artifacts/RetroAchievementsSharp.1.1.1.nupkg --api-key <key> --source https://api.nuget.org/v3/index.json

See publishing.md for details.

Testing

Tests are split into two projects:

dotnet test RetroAchievementsSharp.sln -c Release          # fast suite, all TFMs (net10, net11)
dotnet test RetroAchievementsSharp.sln -f net11.0          # fast suite, one TFM
dotnet test RetroAchievementsSharp.Slow.Tests -c Release   # slow suite (manual — not in the sln)

The fast suite (RetroAchievementsSharp.Tests, in the solution — 415 tests, seconds) runs every ported rcheevos test/rhash vector (cartridge, disc, cdreader, zip, m3u, handler order), synthetic 3DS/CHD fixtures, and CLI/engine unit tests. The slow suite (RetroAchievementsSharp.Slow.Tests, kept out of the solution — 172 tests, minutes) is run manually and covers:

  • Tier-2 parity harness vs. a source-built C oracle (rcheevos 12.5.0, falling back to the pinned 1.8.3 build): 90 generated cases + all CLI arg modes; stdout/stderr + exit codes byte-identical.
  • RVZ validation — real GameCube/Wii RVZ images hashed live through RVZSharp must equal the DolphinTool-converted ISO hash (6 files; skips when the libraries or DolphinTool are absent).
  • Real-ROM parity — first files of 60 user library directories vs. the pinned 1.8.3 binary (skipped-with-note when the libraries or oracle are absent).
  • Published-hash spot checks — real ROM samples hashed and looked up in a RetroAchievements game-database snapshot, asserting official matches per library (skips when the snapshot isn't present).

See parity-evidence.md for the coverage table and known-quirks.md for the unsupported-format behavior (ROM encoding not part of rcheevos).

Parity evidence

Current: 439/439 fast + 172/172 slow green on net10.0, net11.0 — byte-identical CLI output between RetroAchievementsSharp.exe and the C oracles, including verbose mode, error paths, and exit codes; RVZ-vs-ISO equality 6/6 (GameCube and Wii); real-ROM parity 61/61; published-hash spot-check 15/15 library/console pairs. The harness has caught and fixed real port bugs (arg-count guard crash, wildcard path construction, usage banner blank line, silent merge_callbacks bug) — parity is never "accepted" as a difference; it's asserted.

Documentation

Full docs — architecture, engine deep-dives, testing, known quirks, and the release-sync playbook for absorbing future rcheevos releases:

Credits

  • LeXofLeviafan — author of the RALibretro RAHasher CLI this project is behaviorally compatible with. We use his RAHasher binaries as the reference oracle in our parity test suite (byte-identical output vs. the C original is asserted on every run). Thank you!
  • RetroAchievements / rcheevos — the hashing engine, ported 1:1 (MIT).

License

GPL-2.0-or-later — see LICENSE and THIRD-PARTY-NOTICES.md. Copyright (c) 2026 Peterson Fernandes and Pure Logic Code. The rcheevos engine is ported 1:1 (MIT, credited in the notices); RVZ/WIA hashing links RVZSharp which is GPL-2.0-or-later (Dolphin-derived). Program.cs, FileUtil.cs, Hash3DS.cs, and ChdCdReader.cs are new implementations written for behavior parity with the GPL-3.0 RALibretro RAHasher by LeXofLeviafan (used as read-only reference, never copied; the GPL binary and sources live in References\ only and are not shipped).

Changelog

See CHANGELOG.md.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.1 53 11/21/2026
1.1.0 58 11/21/2026
1.0.0 174 8/16/2026