Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use crypto.sha1() instead of sha1sum command #55

Merged
merged 12 commits into from
Oct 12, 2022
Merged

Use crypto.sha1() instead of sha1sum command #55

merged 12 commits into from
Oct 12, 2022

Conversation

mist714
Copy link
Contributor

@mist714 mist714 commented Oct 11, 2022

  • Delete sha1sum command
  • Add Compatibility tests for old version of hash

@mist714 mist714 changed the title Use golang sha1sum instead of sha1sum command Use crypto sha1sum instead of sha1sum command Oct 11, 2022
@mist714 mist714 changed the title Use crypto sha1sum instead of sha1sum command Use crypto sha1sum instead of sha1sum command and delete travis link Oct 11, 2022
@mist714 mist714 requested a review from everpeace October 11, 2022 10:31
Copy link
Contributor

@everpeace everpeace left a comment

Choose a reason for hiding this comment

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

@mist714 LGTM overall. One thing, could we add a compatibility test for this change?

nits: please update the PR title and description.

@mist714 mist714 changed the title Use crypto sha1sum instead of sha1sum command and delete travis link Use crypto sha1sum instead of sha1sum command Oct 11, 2022
@mist714 mist714 requested a review from everpeace October 12, 2022 00:12
@mist714 mist714 changed the title Use crypto sha1sum instead of sha1sum command Use crypto.sha1() instead of sha1sum command Oct 12, 2022
Copy link
Contributor

@everpeace everpeace left a comment

Choose a reason for hiding this comment

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

Thank you for adding the compatibility test🚀 LGTM overall! Please check my comments.

"github.com/stretchr/testify/assert"
)

func CalculateHashWithCommand(filepath string) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nits: no need to export this function. could we make it private?

return hash, nil
}

func TestHashCompatibility(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a comment here on why we have this test here??

@mist714 mist714 requested a review from everpeace October 12, 2022 01:15
Copy link
Contributor

@everpeace everpeace left a comment

Choose a reason for hiding this comment

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

LGTM👍

@mist714 mist714 merged commit e4edd24 into master Oct 12, 2022
@mist714 mist714 deleted the sha1sum branch October 12, 2022 01:18
This was referenced Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants