nats-io / natscli

The NATS Command Line Interface
Apache License 2.0
472 stars 96 forks source link

Displayed ObjectStore digest is truncated #1008

Closed ebusto closed 5 months ago

ebusto commented 6 months ago

Observed behavior

The digest reported when adding a file to an object store, or displaying a file, is truncated. It is missing the last four characters.

% nats obj put test testfile
Object information for test > testfile

               Size: 16 KiB
  Modification Time: 08 Mar 24 17:56 +0000
             Chunks: 1
             Digest: SHA-256 3f4f46a69d15e5a371f792f1d9cee802c63f437f98e8962540de81ce1e36

% shasum -a 256 testfile 
3f4f46a69d15e5a371f792f1d9cee802c63f437f98e8962540de81ce1e36de77  testfile

Expected behavior

The displayed digest should exactly match that calculated by a tool such as shasum.

Server and client version

Server: 2.10.9 Client: 0.1.3

Host environment

Mac OS 14.2.1.

Steps to reproduce

See observed behavior.

ripienaar commented 5 months ago

Hey thanks @ebusto I noticed a bunch of other issues with that code so fixed it all in https://github.com/nats-io/natscli/pull/1017 and then realised I also fixed what your PR was fixing by accident. Sorry, thank you for the contribution in ficxing that but alas already fixed!