On 10/08/2020 12:17, Vlad Khorsun wrote:
> 10.08.2020 17:49, Alex Peshkoff via Firebird-devel wrote:
>> On 2020-08-10 13:31, Dimitry Sibiryakov wrote:
>>> 10.08.2020 12:23, Alex Peshkoff via Firebird-devel wrote:
>>>> CRC32 returns 32-bit integer.
>>>> HASH(something USING method) returns varbinary of appropriate length.
>>>> What should be return value of HASH(something USING CRC32)?
>>>
>>>   32 bits integer. It won't be the first function whose result
>>> depends on parameter.
>>>
>>
>> OK.
>
>   Same function returning different types depending on input argument
> - very bad idea,
> I think. If we have some in the past it doesn't means we should add
> more mess "just
> because we can".
>

I disagree. It's worse to have a hash function not part of HASH function.


>   Is it possible to pass hash method as parameter ? If not now - could
> it be possible
> in the feature ? If yes - what type of result HASH should return for
> CRC32 in this case
> (i.e. when method name is passed as parameter) ?
>

Hash method is fixed at compile time, so I don't see a problem.


>   Currently, HASH supports MD5, SHA1, SHA256 and SHA512 - all these
> algorithms are used
> in cryptography, as Mark said in start message of this thread. Why mix
> CRC32 in here ?
> It is completely different alg for different purposes. What problem we
> want to address
> here ? BTW, any plans to add CRC64 ?
>
If CRC32 is a hash, and look like it is, then it's the place to go.


Adriano



Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to