Trabla: Php & ruby: ruby equivalent ( analog ) of php md5 function
Solving:
1. PHP code:
<?php
$password = "trololo";
echo md5($password);
?>
Result: 37f62f1363b04df4370753037853fe88
2. Ruby code:
// Require Ruby Standart Library
// MD5 and SHA1 digest implementations.
require 'digest'
password = 'trololo'
// calculate md5 and print it
puts Digest::MD5.hexdigest( password )
Result: 37f62f1363b04df4370753037853fe88
No comments:
Post a Comment