Jump to content

jerry_m

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jerry_m's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ups, my mistake, it is >> there.
  2. Thanks for the reply, well i have partially convert them to php but i have other results than the original js.. function t1($num) { $hex_chr = "0123456789abcdef"; $str = ""; for ($j = 0; $j <= 3; $j++) $str .= $hex_chr[($num >> ($j * 8 + 4)) & 0x0F].$hex_chr[($num >> ($j * ) & 0x0F]; return $str; } function t2($str) { $nblk = ((strlen($str) + >> 6) + 1; $blks = array(); for ($i = 0; $i < $nblk * 16; $i++) $blks[$i] = 0; for ($i = 0; $i < strlen($str); $i++) $blks[$i >> 2] |= $str[$i] << (($i % 4) * ; $blks[$i >> 2] |= 0x80 << (($i % 4) * ; $blks[$nblk * 16 - 2] = strlen($str) * 8; return $blks; } function t3($x, $y) { $lsw = ($x & 0xFFFF) + ($y & 0xFFFF); $msw = ($x >> 16) + ($y >> 16) + ($lsw >> 16); return ($msw << 16) | ($lsw & 0xFFFF); } function t4($num, $cnt) { return ($num << $cnt) | ($num >>> (32 - $cnt)); } function t5($a, $b, $c, $d, $x, $s, $t) { return cmn(($b & $c) | ((~$b) & $d), $a, $b, $x, $s, $t); }
  3. Hi there, i have tried without any luck to convert this functions from js to php, can someone help me please? function t1(num) { var hex_chr = "0123456789abcdef"; str = ""; for (j = 0; j <= 3; j++) str += hex_chr.charAt((num >> (j * 8 + 4)) & 0x0F) + hex_chr.charAt((num >> (j * ) & 0x0F); return str; } function t2(str) { nblk = ((str.length + >> 6) + 1; blks = new Array(nblk * 16); for (i = 0; i < nblk * 16; i++) blks[i] = 0; for (i = 0; i < str.length; i++) blks[i >> 2] |= str.charCodeAt(i) << ((i % 4) * ; blks[i >> 2] |= 0x80 << ((i % 4) * ; blks[nblk * 16 - 2] = str.length * 8; return blks; } function t3(x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xFFFF); } function t4(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)); } function t5(a, b, c, d, x, s, t) { return cmn((b & c) | ((~b) & d), a, b, x, s, t); }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.