Ver Mensaje Individual
  #13 (permalink)  
Antiguo 18/01/2011, 10:49
nevusdotcom
 
Fecha de Ingreso: octubre-2010
Mensajes: 24
Antigüedad: 13 años, 6 meses
Puntos: 0
Respuesta: Sirve en el servidor local pero no en el del hosting.

Cita:
Iniciado por portalmana Ver Mensaje
P.D.: Después dime como al final lo pudiste solucionar, uno nunca sabe cuando va a caer en estos problemas...
Saludos
Usamos esta funcion para forzar u obligar a enteros signed de 32bits, asi no importa la estructura del procesador ni alguna variable, de esta forma la funcion daba los resultados iguales en ambos servidores:


Código PHP:
Ver original
  1. function ticket($pin){
  2. function thirtyTwoBitIntval($value)
  3. {
  4.     if ($value < -2147483648)
  5.     {
  6. return -(-($value) & 0xffffffff);
  7.     }
  8.     elseif ($value > 2147483647)
  9.     {
  10. return ($value & 0xffffffff);
  11.     }
  12.     return $value;
  13. }
  14. $pin=strtoupper($pin);
  15. $pin=str_split($pin);
  16. $istore2 = 0;
  17. $istore3 = 1313;
  18. for ($w = 0; $w < count($pin); $w++){
  19. $istore5 =  ord($pin[$w]);
  20. $istore2 = thirtyTwoBitIntval(thirtyTwoBitIntval($istore2) * $istore3);
  21. $istore21= thirtyTwoBitIntval(((($istore5 *$istore5) *$istore5) * 667)*$w);
  22. $istore2 = thirtyTwoBitIntval(thirtyTwoBitIntval($istore2) + thirtyTwoBitIntval($istore21));
  23. }
  24. $istore2 = thirtyTwoBitIntval((thirtyTwoBitIntval($istore2) & 2147483647) % 65536);
  25. for ($istore5 = 4; $istore5 >= 0; $istore5-- ){
  26. $astore4[$istore5] = ((int)$istore2 % 10) + 48;
  27. $istore2 = (int)$istore2 / 10;
  28. }
  29. $key=0;
  30. for ($i=1; $i<count($astore4); $i++){
  31. $key.=chr($astore4[$i]);
  32. }
  33. return $ticket;
  34. }
Agradezco muchisimo tu ayuda, aqui te dejo el codigo por si llegas a pasar algun dia por ese problema.

Última edición por nevusdotcom; 18/01/2011 a las 10:55