Skip to content

Use sha256 to hash file contents#29935

Merged
RyanCavanaugh merged 1 commit into
microsoft:masterfrom
RyanCavanaugh:md5_2_sha
Feb 15, 2019
Merged

Use sha256 to hash file contents#29935
RyanCavanaugh merged 1 commit into
microsoft:masterfrom
RyanCavanaugh:md5_2_sha

Conversation

@RyanCavanaugh
Copy link
Copy Markdown
Member

The security team is complaining because we're not allowed to use cryptographically-compromised hash functions for non-crypto purposes if those functions were ever used by other people for crypto purposes in the past. 🤷‍♂️

Benchmarks show this to be about 30% slower compared to MD5, but we're generally looking at about 8.7ms to SHA256 checker.ts vs 6.4ms for MD5, so the net effect on any program that fits in memory should be less than 30ms overall.

As a side note, generateDjb2Hash is 40 times slower than sha256 - if this is ever called in practice, we should probably make it faster.

@RyanCavanaugh RyanCavanaugh merged commit d517713 into microsoft:master Feb 15, 2019
@RyanCavanaugh RyanCavanaugh deleted the md5_2_sha branch February 15, 2019 18:28
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants