go-digest icon indicating copy to clipboard operation
go-digest copied to clipboard

blake3 is a variable output algorithm, so is this blake3-256?

Open rchincha opened this issue 1 year ago • 1 comments

https://github.com/opencontainers/go-digest/blob/22b78e47854adc56477927aba5f4c930b56af8c9/algorithm.go#L98

https://github.com/zeebo/blake3/blob/master/api.go#L17 ^ does appear to default to 256-bit output, but would still make this mnemonic explicit

rchincha avatar Jul 29 '24 19:07 rchincha

A shorter mnemonic such as "b3-256" would be nicer, but runs the risk of name collision with a "barfoo3-256" hash func.

rchincha avatar Jul 29 '24 19:07 rchincha

...but runs the risk of name collision...

Everyone stepping in to use their own digest algorithm slug without registering it to claim the name. Which is why image-spec says:

If a useful algorithm is not included in the above table, it SHOULD be submitted to this specification for registration.

But sure, if you pick something fairly weird like pet+name+and+favorite+rock as your algorithm slug, and opt not to register, at least you'll have something fun to talk about with the other devs who picked that same slug with different semantics if/when you bump into them ;)

But opencontainers/image-spec#1240 is in flight to register blake3 as an optional (MAY implement) digest algorithm, and it is trying to clarify the hash length (The hash output length MUST be 256 bits).

wking avatar Feb 19 '25 05:02 wking

@rchincha With the merging of https://github.com/opencontainers/image-spec/pull/1240, is this good to be closed?

sudo-bmitch avatar Apr 24 '25 18:04 sudo-bmitch