On 10-08-2020 18:28, Alex Peshkoff via Firebird-devel wrote:
On 2020-08-10 18:57, Mark Rotteveel wrote:
In any case that could be tackled because HASH(<expression> USING
<expression>) is a different function than HASH(<expression> USING
<keyword-hash-names>) and thus can have different return type (eg
VARBINARY that is long enough for all hashes), then HASH(<expression>
USING 'CRC32') would return say a VARBINARY(64) with 4 bytes, while
HASH(<expression> USING CRC32) returns an INTEGER.
Good way to make CRC32 useless - it's typically used to calculate
indices in hash tables. Is it convenient to work with VARBINARY here?
On contrary - for crypto-hashes your suggestion works fine.
I don't think that his minor design problem of a hypothetical function
that accepts a string input to select the hash is a reason to unify the
actual hash functions under a single consistent form.
And if the hypothetical function becomes a reality, you could
reconstruct the INT from the VARBINARY content if necessary.
Mark
--
Mark Rotteveel
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel