Skip to content

Conversation

@mahadzaryab1
Copy link
Contributor

@mahadzaryab1 mahadzaryab1 commented Sep 28, 2024

  • Added a Hash sink that returns the hex encoded hash of the pipe contents based on the hash.Hash argument passed into the method
  • Added a HashSums filter that produces the hex encoded hash of the files in the path

This PR resolves #113, #130.

Copy link
Owner

@bitfield bitfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Could you also please deprecate SHA256Sum(s) in favour of the new methods?

Copy link
Owner

@bitfield bitfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Copy link
Owner

@bitfield bitfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Just a couple of tweaks needed.

script.go Outdated

// SHA256Sum returns the hex-encoded SHA-256 hash of the entire contents of the
// pipe, or an error.
// Deprecated: SHA256Sum has been deprecated by [Pipe.Hash]. To get the SHA 256
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Deprecated: SHA256Sum has been deprecated by [Pipe.Hash]. To get the SHA 256
// Deprecated: SHA256Sum has been deprecated by [Pipe.Hash]. To get the SHA-256

script.go Outdated
// SHA256Sums reads paths from the pipe, one per line, and produces the
// hex-encoded SHA-256 hash of each corresponding file, one per line. Any files
// that cannot be opened or read will be ignored.
// Deprecated: SHA256Sums has been deprecated by [Pipe.HashSums]. To get the SHA 256
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Deprecated: SHA256Sums has been deprecated by [Pipe.HashSums]. To get the SHA 256
// Deprecated: SHA256Sums has been deprecated by [Pipe.HashSums]. To get the SHA-256

script.go Outdated
// hex-encoded SHA-256 hash of each corresponding file, one per line. Any files
// that cannot be opened or read will be ignored.
// Deprecated: SHA256Sums has been deprecated by [Pipe.HashSums]. To get the SHA 256
// encoding for the paths in the pipe, call `HashSums(sha256.new())`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// encoding for the paths in the pipe, call `HashSums(sha256.new())`
// hash for each file path in the pipe, call `HashSums(sha256.new())`

@mahadzaryab1 mahadzaryab1 requested a review from bitfield October 2, 2024 01:49
Copy link
Owner

@bitfield bitfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! Thanks again.

@bitfield bitfield merged commit 6fff62a into bitfield:master Oct 2, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add SHA-512 Hashing Sink

2 participants