home *** CD-ROM | disk | FTP | other *** search
/ Computer Active 2010 August / CA08.iso / Multimedija / shufflr.air / ShufflrClient.swf / scripts / com / adobe / utils / IntUtil.as
Encoding:
Text File  |  2010-06-23  |  1.3 KB  |  51 lines

  1. package com.adobe.utils
  2. {
  3.    public class IntUtil
  4.    {
  5.       private static var hexChars:String = "0123456789abcdef";
  6.       
  7.       public function IntUtil()
  8.       {
  9.          super();
  10.       }
  11.       
  12.       public static function toHex(param1:int, param2:Boolean = false) : String
  13.       {
  14.          var _loc4_:int = 0;
  15.          var _loc5_:int = 0;
  16.          var _loc3_:String = "";
  17.          if(param2)
  18.          {
  19.             _loc4_ = 0;
  20.             while(_loc4_ < 4)
  21.             {
  22.                _loc3_ += hexChars.charAt(param1 >> (3 - _loc4_) * 8 + 4 & 0x0F) + hexChars.charAt(param1 >> (3 - _loc4_) * 8 & 0x0F);
  23.                _loc4_++;
  24.             }
  25.          }
  26.          else
  27.          {
  28.             _loc5_ = 0;
  29.             while(_loc5_ < 4)
  30.             {
  31.                _loc3_ += hexChars.charAt(param1 >> _loc5_ * 8 + 4 & 0x0F) + hexChars.charAt(param1 >> _loc5_ * 8 & 0x0F);
  32.                _loc5_++;
  33.             }
  34.          }
  35.          return _loc3_;
  36.       }
  37.       
  38.       public static function ror(param1:int, param2:int) : uint
  39.       {
  40.          var _loc3_:int = 32 - param2;
  41.          return param1 << _loc3_ | param1 >>> 32 - _loc3_;
  42.       }
  43.       
  44.       public static function rol(param1:int, param2:int) : int
  45.       {
  46.          return param1 << param2 | param1 >>> 32 - param2;
  47.       }
  48.    }
  49. }
  50.  
  51.