đ How to Use SHA1 on macOS â
đ What is a SHA1 Checksum? â
SHA1 (Secure Hash Algorithm 1) is a cryptographic hash function that generates a unique string for a file. Use it to:
- â Verify file integrity (detect tampering).
- đ Authenticate downloads by matching checksums.
âī¸ Generate a SHA1 Checksum â
1ī¸âŖ Open Terminal â
- Search for Terminal with
Cmd + Space
(Spotlight).
2ī¸âŖ Navigate to the File â
- Use the
cd
command to locate your file:bashcd /path/to/your/file
3ī¸âŖ Run the Checksum Command â
- Replace
yourfile
with the file name:bashshasum -a 1 yourfile
- Example output:
da39a3ee5e6b4b0d3255bfef95601890afd80709 yourfile
4ī¸âŖ Compare Values â
- Match the checksum from the output with the source-provided value.
đ Use SHA1 with curl
â
1ī¸âŖ Download the File â
- Use
curl
with the file URL:bashcurl -O https://example.com/myfile.pkg
2ī¸âŖ Generate the Checksum â
- Run the SHA1 command:bash
shasum -a 1 myfile.pkg
3ī¸âŖ Verify Integrity â
- Compare the generated checksum with the one provided by the source.
đ Example Workflow â
- Download the file:bash
curl -O https://example.com/software.pkg
- Generate SHA1 checksum:bash
shasum -a 1 software.pkg
- Compare checksum:
- Provided:
abc123...
- Output:
abc123... software.pkg
- â Match means the file is secure.
- Provided: