I didn't realize that there was a CLI tool that
could recompute the
hex checksum of each record. (I don't count things like Perl).
Well, if "things like perl" means "anything with enough generality to
recompute checksums", that becomes..uninteresting. :) If it means
something more like "Turing-complete languages", it's not much more
interesting. But if you're willing to accept a bti of awk, it's
doable. I'd probably do something like
...the record... | sed -e 's/../& /g' | cvtbase X d |
awk '{sum += $1;} END {printf("%02x\n",255-(sum%256));}'
mutatis mutandis if the checksum algorithm is more complicated than a
simple "all bytes sum to 0x00". Inserting the resulting checksum into
the record is left as an exercise for the reader. (cvtbase is my own,
but as used here just converts 0-9A-F hex to decimal; I believe you can
do that with dc or bc or some such instead. Or you can pick up
ftp.rodents.montreal.qc.ca:/mouseware/hacks/cvtbase.c. :)
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse at rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B