Skip to main content

ipl3checksum PyPI - Downloads GitHub License GitHub release (latest SemVer) PyPI GitHub contributors

A Python library to calculate the IPL3 checksum for N64 ROMs.

How to use it?

First you need to install the library, one way of doing it is via pip.

python3 -m pip install -U ipl3checksum

Now you can invoke the library from your script.

romBytes = # A big endian bytes-like object
cickind = ipl3checksum.CICKind.CIC_6102_7101

checksum = ipl3checksum.calculateChecksum(romBytes, cickind)
assert checksum is not None # Not able to compute the checksum, probably because rom was too small

print(f"{checksum[0]:08X}")
print(f"{checksum[1]:08X}")

This library also contains a CIC detector:

cickind = ipl3checksum.detectCIC(romBytes)
print(cickind) # Either a `ipl3checksum.CICKind` or None if was not able to detect the CIC

Where does this come from?

This algorithm comes directly from the IPL3, which each variant is part of the first 0x1000 bytes of the rom of every retail N64 ROM.

There are various implementations floating around on the internet, but for this specific one was reverse-engineered by myself. I made this because I couldn't find a library to calculate this checksum, so I decided to reverse-engineer it myself instead of taking somebody else's work. It also was an interesting learning experience.

Note about licensing

Most of the repository is licensed under the MIT license, but I also made a reference implementation that is part of the public domain (licensed under CC0-1.0), feel free to use it however you prefer (acknowledgment is always appreciated, but not required).

I want to learn more! What is an IPL3? What is CIC?

I'm not really the guy that can answer all your hunger for knowledge, but here are a few links that may be helpful:

References

Release files for ipl3checksum 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ipl3checksum 1.0.0
File Size Uploaded
ipl3checksum-1.0.0.tar.gz 6.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ipl3checksum 1.0.0
File Interpreter ABI Platform
ipl3checksum-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 MB

Release files / ipl3checksum-1.0.0.tar.gz

Download URL ipl3checksum-1.0.0.tar.gz
Size 6.3 MB
Tags Source
SHA-256 checksum
How to use checksums
4dad785c7e5207687cc6947e8709872a79fd0dec1680d28986d8a12eddbc28f3
BLAKE2b-256 checksum
How to use checksums
0af43397eb5cff56e3a37c3eda2a0bb81c5839f59c521a2aaf636d3fc2b58855
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / ipl3checksum-1.0.0-py3-none-any.whl

Download URL ipl3checksum-1.0.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b521bff61713d67b40092fcb6dcd6c6e4b5b6320ed547d255ab6be0c9d68aa0
BLAKE2b-256 checksum
How to use checksums
3dfa246d3052c8d4ffc626c1d3ac79ae58a0a79af0125106e42f24679140a58e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

1.3.1

66 release files

1.3.0

99 release files

1.2.1

61 release files

1.2.0

83 release files

1.1.1

83 release files

1.1.0

83 release files

1.0.1

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page