Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

The Wright Bothers weren't the first to fly. They were just the first not to crash.


devel / comp.unix.shell / Bang Bits in Bash (with od and rm)

SubjectAuthor
* Bang Bits in Bash (with od and rm)Rick Hohensee
`- Bang Bits in Bash (with od and rm)Rick Hohensee

1
Bang Bits in Bash (with od and rm)

<0351745e-2e54-42ea-b469-e35952986a27n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6577&group=comp.unix.shell#6577

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:622a:1a0a:b0:412:3f1:aafa with SMTP id f10-20020a05622a1a0a00b0041203f1aafamr316694qtb.5.1693018843061;
Fri, 25 Aug 2023 20:00:43 -0700 (PDT)
X-Received: by 2002:a4a:4f82:0:b0:571:1762:7718 with SMTP id
c124-20020a4a4f82000000b0057117627718mr766117oob.1.1693018842712; Fri, 25 Aug
2023 20:00:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!newsfeed.hasname.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Fri, 25 Aug 2023 20:00:42 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=38.105.72.65; posting-account=OcRAMAoAAAArFDHhZFYw2-58_dk-x0_f
NNTP-Posting-Host: 38.105.72.65
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0351745e-2e54-42ea-b469-e35952986a27n@googlegroups.com>
Subject: Bang Bits in Bash (with od and rm)
From: presidentbyamendment@gmail.com (Rick Hohensee)
Injection-Date: Sat, 26 Aug 2023 03:00:43 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1646
 by: Rick Hohensee - Sat, 26 Aug 2023 03:00 UTC

#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))
echo $E

}

Re: Bang Bits in Bash (with od and rm)

<26c7d54c-2821-4d1c-b78a-d1c8ac0fdf6cn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6582&group=comp.unix.shell#6582

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:622a:1b8d:b0:40f:c886:ef3a with SMTP id bp13-20020a05622a1b8d00b0040fc886ef3amr568627qtb.3.1693057391577;
Sat, 26 Aug 2023 06:43:11 -0700 (PDT)
X-Received: by 2002:a05:6830:10da:b0:6bc:b5dc:7b6d with SMTP id
z26-20020a05683010da00b006bcb5dc7b6dmr597085oto.2.1693057391272; Sat, 26 Aug
2023 06:43:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Sat, 26 Aug 2023 06:43:11 -0700 (PDT)
In-Reply-To: <0351745e-2e54-42ea-b469-e35952986a27n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=98.231.178.227; posting-account=OcRAMAoAAAArFDHhZFYw2-58_dk-x0_f
NNTP-Posting-Host: 98.231.178.227
References: <0351745e-2e54-42ea-b469-e35952986a27n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <26c7d54c-2821-4d1c-b78a-d1c8ac0fdf6cn@googlegroups.com>
Subject: Re: Bang Bits in Bash (with od and rm)
From: presidentbyamendment@gmail.com (Rick Hohensee)
Injection-Date: Sat, 26 Aug 2023 13:43:11 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2204
 by: Rick Hohensee - Sat, 26 Aug 2023 13:43 UTC

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

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor