CMPC
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Checksum

Go down

Checksum Empty Checksum

Post by Corey Sun Feb 07, 2010 4:25 am

Here's an excerpt form version one of Enoki>CheckSummer (part of the Enoki Suite I'm working on)
Code:

#define file "CHANGE THIS!"
dim as string txt, outp
dim as uinteger tasc,tlet

open file for input as #1
do until eof(1)
    line input #1,txt
    for itr as integer = 0 to len(txt)-1
        tasc = tasc + txt[itr]
    next
    tlet = tlet + len(txt)
loop
close #1

outp = hex(tasc)& hex(tlet)&  hex(tasc/tlet)&  hex(tasc*tlet)
if len(outp) mod 8 > 0 then
    for add as integer = 1 to 8 - (len(outp) mod 8)
        outp = outp & chr(outp[add-1])
    next add
end if
print outp
sleep

It still has some problems that version two will fix, as well as some missing features. But, I thought it might be useful.
Corey
Corey
Mod

Posts : 462

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum