Displaying 1 result from an estimated 1 matches for "text_decrypt".
2006 Aug 14
0
NEWBIE QUESTION - recode in Ruby
I wish to recode the following php code to ruby:
function text_decrypt_symbol($s, $i) {
# $s is a text-encoded string, $i is index of 2-char code. function
returns number in range 0-255
return (ord(substr($s, $i, 1)) - 100)*16 + ord(substr($s, $i
+1, 1)) - 100;
}
function text_decrypt($s) {
if ($s == "")
return $s;
$enc = 85...