MD5 in PHP
md5 ( string $string , bool $binary = false ) : string
echo md5('proose.com');
MD5 in Java
String txt = "your string here";
MessageDigest m = MessageDigest.getInstance("MD5");
m.reset();
m.update(txt.getBytes());
byte[] digest = m.digest();
BigInteger bigInt = new BigInteger(1,digest);
String md5text = bigInt.toString(16);
// Now we need to zero pad it if you actually want the full 32 chars.
while(hashtext.length() < 32 ){
md5text = "0"+hashtext;
}
MD5 in C#
using System;
using System.Security.Cryptography;
using System.Text;
internal class mymd5
{
private static void Main()
{
var source = "Proose.com";
// Creates an instance of the default implementation of the MD5 hash algorithm.
using (var md5Hash = MD5.Create())
{
// Byte array representation of source string
var sourceBytes = Encoding.UTF8.GetBytes(source);
// Generate hash value(Byte Array) for input data
var hashBytes = md5Hash.ComputeHash(sourceBytes);
// Convert hash byte array to string
var hash = BitConverter.ToString(hashBytes).Replace("-", string.Empty);
// Output the MD5 hash
Console.WriteLine("The MD5 hash of " + source + " is: " + hash);
}
}
}
MD5 in NodeJS
var crypto = require('crypto'); var name = 'Proose'; var hash = crypto.createHash('md5').update(name).digest('hex'); console.log(hash);MD5 in MySql
mysql> SELECT MD5('testing');