----------------------------------------------------------------------------------
@MSGID:
<26c7d54c-2821-4d1c-b78a-d1c8ac0fdf6cn@googlegroups.com> fdcc2616
@REPLY:
<0351745e-2e54-42ea-b469-e35952986a27n@googlegroups.com> cd592f63
@REPLYADDR Rick Hohensee
<presidentbyamendment@gmail.com>
@REPLYTO 2:5075/128 Rick Hohensee
@CHRS: CP866 2
@RFC: 1 0
@RFC-References:
<0351745e-2e54-42ea-b469-e35952986a27n@googlegroups.com>
@RFC-Message-ID:
<26c7d54c-2821-4d1c-b78a-d1c8ac0fdf6cn@googlegroups.com>
@TZUTC: -0700
@PID: G2/1.0
@TID: FIDOGATE-5.12-ge4e8b94
On Friday, August 25, 2023 at 11:00:45 PM UTC-4, Rick Hohensee wrote:
> #Bit-Banging in Bash (with od and rm)
>
> # Adler32 checksum of a file with Bash, rm, and od.
> # Rick rickfordictator.com Hohensee August 2023
> # E is the checksum. Android .dex files use Adler32.
> # not checked much, but it is clearly doing binary data.
>
> decimalbytes ()
> {
> od -An -v -t d1 -w1 $1 >> decimal.out
> }
>
>
> Subadler () { # < decimal.out
> A=1 B=0
> while read
> do
> let A=$(($A+$REPLY))
> let A=$(($A&0xffffffff))
> let B=$B+$A
> let B=$(($B&0xffffffff))
> done
> }
>
>
> Adler32 () {
> decimalbytes $1
>
> Subadler < decimal.out
> rm decimal.out
> C=$((A%65521))
> D=$((B%65521))
> echo "C =" $C " D = " $D
> E=$(((D<<16)|C))
should be E=$(((C<<16)|D))
and the low two bytes still don`t match an online example, but the
high two bytes do
--- G2/1.0
* Origin: usenet.network (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5075/128
@PATH: 5075/128 5020/1042 4441