hash library
RetroAchievements ROM and optical disc hashing module (rhash).
Migrated to Dart from RetroAchievements/rcheevos.
Classes
- CompositeCdReader
-
Composite RcCdReader that automatically selects between
ChdCdReaderand Iso9660CdReader. - DefaultRcFileReader
- Default RcFileReader implementation using dart:io and RandomAccessFile.
- ExtractedZipRom
- A ROM selected from a ZIP archive.
- Iso9660CdReader
- Built-in RcCdReader implementation for ISO 9660 optical discs (ISO, BIN, CUE).
- MemoryRcFileReader
- In-memory RcFileReader implementation for buffered data.
- RcCdReader
- Abstract CD/Disc reader interface for RetroAchievements optical media hashing.
- RcDiscEntry
- Disc entry representing a file or directory on a CD / ISO image.
- RcFileReader
- Abstract file reader interface for RetroAchievements ROM/disc hashing. Allows customizing file access (e.g., in-memory buffers, ZIP archives, CHD files).
- RcHashIterator
- Iterator for generating and cycling through RetroAchievements hashes for a given ROM / disc.
- RcHashResult
- Result of hashing a ROM or disc for RetroAchievements.
Enums
- RcSeekOrigin
- Seek origin for file reading.
Constants
- rcHashCdTrackFirstData → const int
-
Special track selectors matching rcheevos
RC_HASH_CDTRACK_*. - rcHashCdTrackFirstOfSecondSession → const int
- rcHashCdTrackLargest → const int
- rcHashCdTrackLast → const int
Functions
-
extractZipRom(
String path, {RcFileReader fileReader = const DefaultRcFileReader(), Uint8List? directBytes}) → Future< Uint8List?> - Extracts the primary candidate ROM file bytes from a .zip archive.
-
extractZipRomEntry(
String path, {RcFileReader fileReader = const DefaultRcFileReader(), Uint8List? directBytes}) → Future< ExtractedZipRom?> - Extracts the primary candidate ROM and preserves its inner filename so the platform-specific dispatcher can process it correctly.
-
hash3doDisc(
String path, {RcCdReader cdReader = const CompositeCdReader()}) → Future< String?> -
Hashes a 3DO disc image by parsing the OperaFS filesystem for
LaunchMeand computing MD5(132-byte volume header + LaunchMe executable bytes). -
hashArcade(
String path, {RcFileReader fileReader = const DefaultRcFileReader(), Uint8List? directBytes}) → Future< String?> -
Hashes an Arcade / FBNeo game according to RetroAchievements rcheevos
rc_hash_arcadeandrc_hash_neogeo_cart. -
hashArduboy(
String path, {RcFileReader fileReader = const DefaultRcFileReader(), Uint8List? directBytes}) → Future< String?> - Hashes an Arduboy game (.arduboy FX archive or .hex / text file).
-
hashArduboyFx(
String path, {RcFileReader fileReader = const DefaultRcFileReader(), Uint8List? directBytes}) → Future< String?> -
Hashes an Arduboy FX
.arduboyarchive by filtering only.hexand.binfiles and hashing their sorted zip indices. -
hashArduboyText(
Uint8List bytes) → String -
Normalizes text lines (appending
\nper line) before computing MD5. Matchesrc_hash_textinhash_rom.c. -
hashAtari7800(
Uint8List bytes) → List< String> -
Hashes an Atari 7800 ROM image by checking for and stripping the 128-byte
ATARI7800header. -
hashDreamcastDisc(
String path, {RcCdReader cdReader = const CompositeCdReader()}) → Future< String?> -
Hashes a Sega Dreamcast disc image by reading the 256-byte
IP.BINheader and the boot executable (1ST_READ.BIN). -
hashGamecubeDisc(
String path, {RcFileReader fileReader = const DefaultRcFileReader()}) → Future< String?> - Hashes a GameCube disc image (.iso, .gcm, .ciso) by computing MD5(header + apploader + 18 main.dol segments).
-
hashJaguarCd(
String path, {RcCdReader cdReader = const CompositeCdReader()}) → Future< String?> - Hashes an Atari Jaguar CD boot executable, including the homebrew KART fallback used by rcheevos.
-
hashLynx(
Uint8List bytes) → List< String> -
Hashes an Atari Lynx ROM image by checking for and stripping the 64-byte
LYNXheader. -
hashMsDos(
String path, {RcFileReader fileReader = const DefaultRcFileReader(), Uint8List? directBytes}) → Future< String?> -
Hashes an MS-DOS
.doszor.ziparchive according to RetroAchievements rcheevosrc_hash_ms_dos. -
hashN64(
String path, {RcFileReader fileReader = const DefaultRcFileReader(), Uint8List? directBytes}) → Future< String?> - Hashes a Nintendo 64 ROM image by normalizing its endianness to standard big-endian (.z64) before computing the MD5 hash.
-
hashNeoGeoCd(
String path, {RcCdReader cdReader = const CompositeCdReader()}) → Future< String?> -
Hashes a Neo Geo CD disc image by finding
IPL.TXTand hashing each referenced.PRGfile. -
hashNintendo3ds(
String path, {RcFileReader fileReader = const DefaultRcFileReader(), Uint8List? directBytes}) → Future< String?> - Hashes unencrypted Nintendo 3DS NCSD/NCCH/CIA, 3DSX, and ELF images.
-
hashNintendoDs(
String path, {RcFileReader fileReader = const DefaultRcFileReader(), Uint8List? directBytes}) → Future< String?> - Hashes a Nintendo DS / DSi ROM image by hashing the 352-byte header, the ARM9 executable, ARM7 executable, and 2560-byte icon/banner section.
-
hashPce(
Uint8List bytes) → List< String> - Hashes a PC Engine / TurboGrafx-16 ROM image by checking for and stripping the 512-byte header.
-
hashPceCd(
String path, {RcCdReader cdReader = const CompositeCdReader()}) → Future< String?> - Hashes a PC Engine CD or PC-FX disc image.
-
hashPcFxCd(
String path, {RcCdReader cdReader = const CompositeCdReader()}) → Future< String?> - Hashes a PC-FX disc using its boot header and program sectors.
-
hashPs2Disc(
String path, {RcCdReader cdReader = const CompositeCdReader()}) → Future< String?> -
Hashes a PlayStation 2 (PS2) disc image by parsing
SYSTEM.CNFfor theBOOT2executable, and computing MD5(exe_name + ELF binary bytes). -
hashPs3(
String path, {RcFileReader fileReader = const DefaultRcFileReader(), RcCdReader cdReader = const CompositeCdReader()}) → Future< String?> - Hashes a PlayStation 3 disc image or extracted/installed EBOOT.BIN.
-
hashPspIso(
String path, {RcCdReader cdReader = const CompositeCdReader()}) → Future< String?> - Hashes a PSP ISO disc image by computing MD5(PSP_GAME/PARAM.SFO + PSP_GAME/SYSDIR/EBOOT.BIN).
-
hashPspPbp(
String path, {RcFileReader fileReader = const DefaultRcFileReader()}) → Future< String?> - Hashes a PSP EBOOT.PBP container as a whole file, matching rcheevos.
-
hashPsxDisc(
String path, {RcCdReader cdReader = const CompositeCdReader()}) → Future< String?> -
Hashes a PlayStation 1 (PSX) disc image by parsing
SYSTEM.CNFfor the boot executable, and computing MD5(exe_name + executable bytes). -
hashScv(
Uint8List bytes) → List< String> -
Hashes an Epoch Super CassetteVision ROM image by checking for and stripping the 32-byte
EmuSCVheader. -
hashSegaCdDisc(
String path, {RcCdReader cdReader = const CompositeCdReader()}) → Future< String?> - Hashes a Sega CD or Sega Saturn disc image by reading the first 512 bytes of sector 0.
-
hashSnesStripped(
Uint8List bytes) → String? - Computes the SNES hash after stripping a 512-byte copier header when the file is 512 bytes larger than a multiple of 8 KiB.
-
hashWiiDisc(
String path, {RcFileReader fileReader = const DefaultRcFileReader()}) → Future< String?> - Hashes a Nintendo Wii disc image or WiiWare container.
-
rcHashCompute(
{String? path, Uint8List? buffer, int? consoleId, RcFileReader fileReader = const DefaultRcFileReader(), RcCdReader? cdReader}) → Future< RcHashResult?> - Convenience function to compute full RcHashResult with primary and alternate hashes.
-
rcHashGenerate(
{String? path, Uint8List? buffer, int? consoleId, RcFileReader fileReader = const DefaultRcFileReader(), RcCdReader? cdReader}) → Future< String?> - Convenience function to generate the primary RetroAchievements hash for a file or buffer.