# TIL: How to generate checksum?

Checksums work like a fingerprint. It is used to verify file integrity. If the files have the same checksums, then they are identical. It can also be used to check if the file has been previously scanned as malicious.

### On Windows:

1. [certutil](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/certutil):
    
    ```bash
    certutil -hashfile <filepath> SHA256
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681477053717/b0cbc661-ee41-412e-96fc-e3d2eeb5231c.png align="left")
    
2. [Get-FileHash](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-filehash?view=powershell-7.3)
    
    ```bash
    Get-FileHash <filepath> -Algorithm SHA256
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681477069290/3542a26e-81ac-4f80-9c26-7bb984dc77e4.png align="left")
    

### On Linux/macOS:

1. [sha256sum](https://man7.org/linux/man-pages/man1/sha256sum.1.html)
    
    ```bash
    sha256sum <filepath>
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681477392350/ffb8b37f-c6c2-4e6a-a09e-d2ea8ebac6fb.png align="center")
    
2. [shasum](https://opensource.apple.com/source/CPANInternal/CPANInternal-62/Digest-SHA/shasum.auto.html)
    
    ```bash
    shasum -a 256 <filepath>
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681477820614/6156ea96-77ac-4155-b095-11ba199c0ce2.png align="center")
    

The file hash can also be checked on [VirusTotal](https://www.virustotal.com/gui/home/search) and [InQuest](https://labs.inquest.net/)

**f29bc64a9d3732b4b9035125fdb3285f5b6455778edca72414671e0ca3b2e0de**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681478175894/2cfca925-2a53-4a38-8482-915bfb62b4f1.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681478260927/989289a1-d01f-417f-8209-5390164721f9.png align="center")
