File Hash Checker API

Category: security

Compute SHA-256 and MD5 hashes for files and optionally verify against an expected hash. Runs entirely in the browser using Web Crypto API.

Endpoint

N/A Browser API (Web Crypto + js-md5)
No Server API

Response

Content-Type: N/A

This tool computes file hashes in the browser using the Web Crypto API and js-md5. No server-side API is available.

// Browser-only: uses Web Crypto API + js-md5

cURL Example

# No cURL equivalent — this tool runs in the browser

Code Samples

// File hashing using Web Crypto API
const file = fileInput.files[0];
const buffer = await file.arrayBuffer();
const hashBuffer = await crypto.subtle.digest('SHA-256', buffer);
const hashHex = Array.from(new Uint8Array(hashBuffer))
    .map(b => b.toString(16).padStart(2, '0')).join('');
console.log('SHA-256:', hashHex);
# File hashing in Python:
import hashlib

with open('file.bin', 'rb') as f:
    sha256 = hashlib.sha256(f.read()).hexdigest()
    print('SHA-256:', sha256)
// File hashing in Java:
import java.security.MessageDigest;
import java.nio.file.Files;
import java.nio.file.Path;

byte[] fileBytes = Files.readAllBytes(Path.of("file.bin"));
MessageDigest md = MessageDigest.getInstance("SHA-256");
byte[] hash = md.digest(fileBytes);