On Wed, Apr 26, 2023 at 02:33:03PM +0000, Albretch Mueller wrote:

[...]

>  because I would like to include the three strings in the file descriptor:
>  a) the crazy long name
>  b) its base64 representation
>  c) §b's sha256sum representation which is the one used for the file
> name and the log of the download.

[...]

It's your work, of course.

> >> // __ $_SHA256:
> >> |7d5895cb24ab49692a8ad495e036074fec8e61b22040544f02a9b69c926dbdeb  -|
> >
> >
> > I only see harmless hexadecimal chars there.
> >
> >>  I am trying to avoid funky characters and sha256sum --text still
> >> generates them!?!
> >
> > Where are there "funky chars"?
> 
>  This is the first time I have seen blank spaces and hyphens in a text
> segment's sum. Those characters might be confusing.

Ah -- I thing someone else (I think it was Dan, sorry if my memory
fails me) pointed that out already. The dash is the "file name"
(which in this case was stdin, this follows a widespread convention).

All those sums output the sum (never ever spaces in there), a
whitespace, then the file name. Background: you can give them
multiple args, then they generate a list of sums and names, which
you then can conveniently use with the -c option to see whether
any of the files has changed.

> > Besides, I don't think --text does what you think it does. Quoting
> > the manpage:
> >
> >   "Note: There is no difference between binary mode and text
> >    mode on GNU systems."
> 
>  Thank you. I was playing with different options to see if that was
> the reason I was getting those white spaces and hyphens at the end.
> 
>  Why is that happening? How could it be avoided? COuld you set the
> characters used in the representation of a sum?

You just cut it out with, e.g. 'cut' like so:

  sha256sum | cut -d' ' -f1

Cheers
-- 
t

Attachment: signature.asc
Description: PGP signature

Reply via email to