git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Numeric constants as strings

From
Junio C Hamano <junkio@cox.net>
Date
Feb 19, 2007, 09:49 UTC
Message-ID
<7vbqjq8ojr.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200702190916.35813.andyparkins@gmail.com>
Andy Parkins <andyparkins@gmail.com> writes:
> I'm working on bringing my hash width literals patch up to
> date now that 1.5.0 has passed.

I do not want to risk discouraging public discussion on this topic, but I am not sure if this is really worth it.

It is not like if/when we find SHA-1 is inadequate we would just switch to SHA-256 and redefine HASH_BYTES from 20 to 32 and be done with it. With the need for backward compatibility, we would probably end up changing "unsigned char sha1[20]" to something that allows us to tell which hash function's result we are talking about, like:

	struct {
	       	enum { SHA_1, SHA_256 } type;
               	union {
                        unsigned char sha1[20];
                        unsigned char sha256[32];
		} u;
	};
Previous: Andy ParkinsNext: Andy Parkins
Message 7 of 11 in “Numeric constants as strings”
  1. Andy ParkinsFeb 19, 2007
  2. Junio C HamanoFeb 19, 2007
  3. Shawn O. PearceFeb 19, 2007
  4. Matthieu MoyFeb 19, 2007
  5. Andy ParkinsFeb 19, 2007
  6. Andy ParkinsFeb 19, 2007
  7. Junio C HamanoFeb 19, 2007
  8. Andy ParkinsFeb 19, 2007
  9. Mark WoodingFeb 19, 2007
  10. Andy ParkinsFeb 19, 2007
  11. Jakub NarebskiFeb 20, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.