From: random832@fastmail.com (Random832)
Subject: [TUHS] why is sum reporting different checksum's between v6 and v7
Date: Sat, 12 Dec 2015 00:38:03 +0000 (UTC) [thread overview]
Message-ID: <n4fq9a$ogr$1@ger.gmane.org> (raw)
In-Reply-To: <566B6467.5060703@gmail.com>
On 2015-12-12, Will Senn wrote:
> # echo "Hello, World" > hi.txt
> # cat hi.txt
> Hello, World
>
> Then on v6:
> # sum hi.txt
> 1106 1
>
> But on v7:
> # sum hi.txt
> 37264 1
Interestingly, I can get both results on OSX:
% echo "Hello, World" | cksum -o 1
37264 1
% echo "Hello, World" | cksum -o 2
1106 1
Or Ubuntu:
% echo "Hello, World" | sum -r
37264 1
% echo "Hello, World" | sum -s
1106 1
Both of these define the one you got in v7 as a "BSD" algorithm.
So it looks like v7's new algorithm didn't make it into USG
Unix, rather it uses the same one as v6. (According to the OSX
manpage, System V eventually grew a "-r" option to use the newer
algorithm).
The second number is the size in blocks, which is 512 for the
"System V" algorithm and 1024 bytes for modern implementations
of the "BSD" algorithm, *but* BUFSIZ (512) for v7.
next prev parent reply other threads:[~2015-12-12 0:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-12 0:03 Will Senn
2015-12-12 0:10 ` Clem cole
2015-12-12 0:38 ` Random832 [this message]
2015-12-12 0:30 Noel Chiappa
2015-12-12 1:07 ` Random832
2015-12-12 1:22 Noel Chiappa
2015-12-12 1:46 ` Random832
2015-12-12 1:50 ` John Cowan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='n4fq9a$ogr$1@ger.gmane.org' \
--to=random832@fastmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).