Checksum
CMPC :: Computing :: Programming :: General Coding
Page 1 of 1
Checksum
Here's an excerpt form version one of Enoki>CheckSummer (part of the Enoki Suite I'm working on)
It still has some problems that version two will fix, as well as some missing features. But, I thought it might be useful.
- 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- Mod
- Posts : 462
CMPC :: Computing :: Programming :: General Coding
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|