Thread Hexadezimale Codierung (9 answers)
Opened by [E|B] at 2004-05-31 18:24

esskar
 2004-05-31 19:20
#25723 #25723
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
versuch mal:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function StringToHexString(str)
{
var retval = "";

var cbdata = str.length;
if(cbdata > 0)
{
var i = 0;
while(cbdata--)
{
var b = (str.charCodeAt(i) & 0xF0) >> 4;
retval += (b <= 9) ? String.fromCharCode(b + 48) : String.fromCharCode((b - 10) + 65);
b = str.charCodeAt(i) & 0x0F;
retval += (b <= 9) ? String.fromCharCode(b + 48) : String.fromCharCode((b - 10) + 65);
i++;
}
}

return retval;
}

View full thread Hexadezimale Codierung