src/sys/dotnet/perwapi/PERWAPI.cs
/// <summary>
/// Derives a hexademical string for an int value
/// </summary>
/// <param name="val">the int value</param>
/// <returns>hex string for the int value</returns>
Derives a hexademical string for an int value
Derives a hexademical string for an int value
public static String Int(int val) {
            char[] str = new char[8];
            uint num = (uint)val;
            int strIx = 7;
            for (int i=0; i < iByteMask.Length; i++) {
                uint b = num & iByteMask[i];
                b >>= (i*8);
                uint b1 = b & nibble0Mask;
                uint b2 = (b & nibble1Mask) >> 4;
                str[strIx--] = hexDigit[b1];
                str[strIx--] = hexDigit[b2];
            }
            return new String(str);
        }
public static String Int ( int val ) { char [ ] str = new char [ 8 ] ; uint num = ( uint ) val ; int strIx = 7 ; for ( int i = 0 ; i < iByteMask . Length ; i ++ ) { uint b = num & iByteMask [ i ] ; b >>= ( i * 8 ) ; uint b1 = b & nibble0Mask ; uint b2 = ( b & nibble1Mask ) >> 4 ; str [ strIx -- ] = hexDigit [ b1 ] ; str [ strIx -- ] = hexDigit [ b2 ] ; } return new String ( str ) ; }
Derives a hexademical string for an int value
Derives a hexademical string for an int value
hex string for the int value
hex string for the int value
val
int
the int value
the int value