User:Strife Onizuka/int2hex
< User:Strife Onizuka
Jump to navigation
Jump to search
Revision as of 17:28, 8 November 2009 by Strife Onizuka (talk | contribs) (Created page with '<lsl> string int2hex(integer I) { integer c = llCeil(llLog((I | 15 | (I >> 1)) & 0x7FFFFFFF) / 2.7725887222397812376689284858327) + 1; I = I << ((9 - c) << 2); intege...')
<lsl> string int2hex(integer I) {
integer c = llCeil(llLog((I | 15 | (I >> 1)) & 0x7FFFFFFF) / 2.7725887222397812376689284858327) + 1; I = I << ((9 - c) << 2); integer A = (I >> 14) & 0x0003C000; integer B = (I >> 16) & 0x00000F00; integer C = (I >> 18) & 0x0000003C; integer D = (I << 10) & 0x3C000000; integer E = (I << 8) & 0x00F00000; integer F = (I << 6) & 0x0003C000; integer G = (I << 4) & 0x00000F00; integer H = (I << 2) & 0x0000003C; return llGetSubString( llInsertString( llIntegerToBase64( A + B + C + 0xD31D34D3//lowercase-x=0xD31D34D3, uppercase-X=0xD17D34D3 - (0x000F8000 * (A / 0x00028000))//lowercase=0x00090000, uppercase=0x000F8000 - (0x00003E00 * (B / 0x00000A00))//lowercase=0x00002400, uppercase=0x00003E00 - (0x000000F8 * (C / 0x00000028))//lowercase=0x00000090, uppercase=0x000000F8 ), 5, llIntegerToBase64( D + E + F + G + H + 0xD34D34D3 - (0xF8000000 * (D / 0x28000000))//lowercase=0x90000000, uppercase=0xF8000000 - (0x03E00000 * (E / 0x00A00000))//lowercase=0x02400000, uppercase=0x03E00000 - (0x000F8000 * (F / 0x00028000))//lowercase=0x00090000, uppercase=0x000F8000 - (0x00003E00 * (G / 0x00000A00))//lowercase=0x00002400, uppercase=0x00003E00 - (0x000000F8 * (H / 0x00000028))//lowercase=0x00000090, uppercase=0x000000F8 ) ), 0, c );
} </lsl>