%
function debug(message)
response.write message
end function
function enc_b32n( edx )
dim i, j, al
al = edx and 31
al = al + ascb("0")
If al > ascb("9") then
al = al + (ascb("A") - ascb(":"))
End If
enc_b32n=chr(al)
end function
function enc32( a )
dim val,bits,c
debug "
Encode:"&join(a,",")
val = 0
bits = 0
for each c in a
if (c > 255) then
print "encountered char > 255 (decimal "&c&")"
'breakpoint
end if
val = val * 2^8
val = val + c
bits = bits + 8
debug ",bits="&bits
if bits >= 5 then
debug ",val="&val
bits = bits - 5
enc32=enc_b32n(val and 31) & enc32
debug ",enc32='"&enc32&"'"
val = val \ (32)
end if
next
if bits > 0 then
debug ",bits="&bits
enc32=enc_b32n(val and 31) & enc32
end if
debug "
"
end function
'response.write "
0="&enc32n(0)
'response.write "
1="&enc32n(1)
'response.write "
255="&enc32n(255)
'response.write "
256="&enc32n(256)
'response.write "
32767="&enc32n(32767)
'response.write "
32768="&enc32n(32768)
'response.end
function decode_b32char( ch )
dim sextet
if ( (ch >= "0") AND (ch <= "9") ) then
sextet = asc(ch) - asc("0")
elseif ( (ch >= "A") AND (ch <= "Z") ) then
sextet = (asc(ch) - asc("A")) + 10
else
sextet = -1
end if
decode_b32char = sextet
end function
'response.write "
"&decode_b32char("0")
function decode(strFile)
dim ch,flushing, intI,temp
dim a,n,i
redim a(len(strFile))
i=0
n=0
temp = 0
flushing = false
debug "
decode:"&strFile
for intI = 1 to len(strFile)
ch = mid(strFile,intI,1)
temp = temp * 2^5
temp = temp + decode_b32char( ch )
debug ",val="&temp
bits = bits + 5
if ( bits >= 8 ) then
bits = bits - 8
strOut = strOut & chr(255 AND (temp \ 2^bits))
a(i) = 255 AND (temp \ 2^bits)
n = n * 256
n = n + (255 AND (temp \ 2^bits))
i = i + 1
temp = temp AND (2^bits - 1)
debug "["&n&"]"
end if
next
debug "."&bits&""
decode = (n*(2^bits))+temp
debug "result="&decode&"
"
end function
'response.write "
0400="&decode("0400")
function enc32n(i)
dim s,v
v = i
s = ""
debug "
v="&v
if v = 0 then s = ",0"
while v > 0
s = s&","&(v and 255)
v = v \ 256
wend
debug ", s="&s&"
"
enc32n = enc32( split(mid(s,2),",") )
end function
'response.write "
"&cdbl(now()) & "=" & decode("4R8")
en = enc32n(cdbl(now()))
response.write "
"&now()&"="&en&FormatDateTime(cdate(decode(en)))
'response.write "
"&enc32(split("192.168.0.5","."))
'response.write "
"&enc32n(now())
'response.write "
"
'response.end
for i = 0 to 256
'for i = 510 to 520
'for i = 1020 to 1030
'for i = 32760 to 32770
'for i = 65530 to 65540
'for i = 37730 to 37740
v = i
s = ""
while v > 0
s = s&","&(v and 255)
v = v \ 256
wend
a = split(mid(s,2),",")
' response.write ", "&i &"="
' response.write enc32(a)
if decode(enc32n(i)) <> i then
' response.write "!="&decode(enc32(a))
response.end
end if
next
' response.write "
1" & enc32(1)
response.end
%>
BY@massmind.org">: