Code:
function convertFromBase64 (buf)
{
while (buf.length & 3) buf += '.'; // make 'buf' a multiple of 4
var dst = new Array;
var j = 0;
for (var i = 0; i < buf.length; i += 4) {
var cc = (b64_char_to_6 [buf.charCodeAt(i)] << 18) |
(b64_char_to_6 [buf.charCodeAt(i+1)] << 12) |
(b64_char_to_6 [buf.charCodeAt(i+2)] << 6) |
(b64_char_to_6 [buf.charCodeAt(i+3)]);
dst[j] = (cc >> 16) & 0xff;
dst[j+1] = (cc >> 8) & 0xff;
dst[j+2] = (cc) & 0xff;
j += 3;
}
return dst;
}
Danke.
Zuletzt bearbeitet: