public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
* Question: how will sha256sum be implemented in git
@ 2025-07-04 11:18 Aditya Garg
  2025-07-04 19:27 ` brian m. carlson
  0 siblings, 1 reply; 3+ messages in thread
From: Aditya Garg @ 2025-07-04 11:18 UTC (permalink / raw)
  To: git@vger.kernel.org

Hi all

I just read that git aims to transition to SHA256 by default, and conversion from SHA1 to SHA256 is needed for old
repos. I was just curious how will that be achieved.

Dumb idea, but maybe we can just encode the existing SHA1 sums' string to SHA256?

Eg: 

$ echo -n 8994f255af5451b6cd1db01ee16d8cf15b9df81e | sha256sum
bf8d6d915848377db81ee47e883c0a683b3d86a49ab120191ea1c3d76a30c33f *-

so bf8d6d915848377db81ee47e883c0a683b3d86a49ab120191ea1c3d76a30c33f will be our new commit hash.

I think we can do that since sha256sum is chosen due to negligible collisions right?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-05  7:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-04 11:18 Question: how will sha256sum be implemented in git Aditya Garg
2025-07-04 19:27 ` brian m. carlson
2025-07-05  7:09   ` Aditya Garg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox