MD5 online generator

md5( )
md5( )

The MD5 message-digest algorithm is a widely used hash function producing a 128-bit hash value. Wikipedia

md5 in PHP

// md5 hash of a string
$str = '';
$hash = md5($str);

// md5 file checksum
$file = 'path/to/file';
$checksum = md5_file($str);

md5 in Node.js

// md5 hash of a string
const crypto = require('crypto');
let hash = crypto.createHash('md5').update('').digest('hex');

// md5 file checksum
const fs = require('fs');
const crypto = require('crypto');
let fd = fs.createReadStream('path/to/file');
let hash = crypto.createHash('md5');
hash.setEncoding('hex');
fd.on('end', () => {
    hash.end();
    let checksum = hash.read();
});
fd.pipe(hash);

md5 in JavaScript

<script type="text/javascript" src="http://www.myersdaily.org/joseph/javascript/md5.js"></script>

<script type="text/javascript">
    // md5 hash of a string
    const str = '';
    let hash = md5(str);
</script>

<input type="file" onchange="calcFile(this)">

<script type="text/javascript">
    // md5 file checksum
    function calcFile(el) {
        let file = el.files[0];
        if (!file) {
            return;
        }
        const reader = new FileReader();
        reader.readAsBinaryString(file);
        reader.onload = () => {
            let result = md5(reader.result);
        };
        reader.onerror = errorHandler;
    }
</script>

md5 in Bash

// md5 hash of a string
echo -n "" | md5sum

// md5 file checksum
md5sum | path/to/file

md5 in MySQL

// md5 hash of a string
SELECT MD5("");

md5 in Python

import hashlib

# md5 hash of a string
md5 = hashlib.md5()
str = ""
md5.update(str)
print md5.hexdigest()

# md5 file checksum
md5_file = hashlib.md5()
with open("path/to/file", "rb") as f:
    for chunk in iter(lambda: f.read(4096), b""):
        md5_file.update(chunk)
print md5_file.hexdigest()