what code encoded in this snippet?

M

mistral

what code encoded in this snippet?

<script language=JavaScript>function dc(x){var
l=x.length,b=1024,i,j,r,p=0,s=0,w=0,t=Array(63,52,61,45,31,28,27,20,36,13,0,0,0,0,0,0,26,6,44,55,24,47,10,50,42,60,30,32,0,35,39,58,18,9,21,2,53,40,5,3,4,23,22,0,0,0,0,62,0,38,11,17,8,48,59,46,16,37,15,1,33,43,54,57,29,56,19,41,51,12,49,7,34,14,25);for(j=Math.ceil(l/b);j>0;j--){r='';for(i=Math.min(l,b);i>0;i--,l--){w|=(t[x.charCodeAt(p++)-48])<<s;if(s){r+=String.fromCharCode(165^w&255);w>>=8;s-=2}else{s=6}}document.write(r)}}dc("VS")</script>

thanks.
 
G

Guest

what code encoded in this snippet?

<script language=JavaScript>function dc(x){var
l=x.length,b=1024,i,j,r,p=0,s=0,w=0,t=Array(63,52,61,45,31,28,27,20,36,13,0,0,0,0,0,0,26,6,44,55,24,47,10,50,42,60,30,32,0,35,39,58,18,9,21,2,53,40,5,3,4,23,22,0,0,0,0,62,0,38,11,17,8,48,59,46,16,37,15,1,33,43,54,57,29,56,19,41,51,12,49,7,34,14,25);for(j=Math.ceil(l/b);j>0;j--){r='';for(i=Math.min(l,b);i>0;i--,l--){w|=(t[x.charCodeAt(p++)-48])<<s;if(s){r+=String.fromCharCode(165^w&255);w>>=8;s-=2}else{s=6}}document.write(r)}}dc("VS")</script>

Not much. Just a space.

function dc(x) {
var l=x.length,b=1024,i,j,r,p=0,s=0,w=0,t=Array(63,52,...)
for(j=Math.ceil(l/b);j>0;j--) // works on blocks of 1024 characters
{r='';for(i=Math.min(l,b);i>0;i--,l--)
{w|=(t[x.charCodeAt(p++)-48])<<s;
if(s){r+=String.fromCharCode(165^w&255);w>>=8;s-=2}else{s=6}
}
document.write(r)
}
}
dc("VS")

dc is a decoder. The variable "r" is created as a string
in the for(i=Math.min(l,b);i>0;i--,l--) loop. In this
case all you are decoding is "VS". s starts at zero.
That does not mean (if(s){r+=String....) that nothing happens
due to the first character (which does not lead to a character
being appended to r) since it modifies the decoding
({w|=(t[x.charCodeAt(p++)-48])<<s) but only the second character
results in a character appearing in the decoded dc("VS").
So it decodes to a single character. That happens to be a space.
 
M

mistral

Spamless said:
On 2006-10-10, mistral wrote:
what code encoded in this snippet?

<script language=JavaScript>function dc(x){var
Not much. Just a space.
function dc(x) {
var l=x.length,b=1024,i,j,r,p=0,s=0,w=0,t=Array(63,52,...)
for(j=Math.ceil(l/b);j>0;j--) // works on blocks of 1024 characters
{r='';for(i=Math.min(l,b);i>0;i--,l--)
{w|=(t[x.charCodeAt(p++)-48])<<s;
if(s){r+=String.fromCharCode(165^w&255);w>>=8;s-=2}else{s=6}
}
document.write(r)
}
}
dc("VS")
dc is a decoder. The variable "r" is created as a string
in the for(i=Math.min(l,b);i>0;i--,l--) loop. In this
case all you are decoding is "VS". s starts at zero.
That does not mean (if(s){r+=String....) that nothing happens
due to the first character (which does not lead to a character
being appended to r) since it modifies the decoding
({w|=(t[x.charCodeAt(p++)-48])<<s) but only the second character
results in a character appearing in the decoded dc("VS").
So it decodes to a single character. That happens to be a space.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top