Skip to content

libsodium.ShortHash

Andrew Lambert edited this page Nov 26, 2022 · 5 revisions

libsodium.ShortHash

Method Signature

 Protected Function ShortHash(InputData As MemoryBlock, Key As MemoryBlock) As UInt64

Parameters

Name Type Comment
InputData MemoryBlock The data to be hashed.
Key MemoryBlock Optional. The key for keyed hashing.

Return value

The hash value, or 0 on error.

Remarks

This method outputs short but unpredictable (without knowing the secret key) values suitable for tasks like hash tables, bloom filters, and integrity checking in interactive protocols; this method is optimized for short inputs.

The output of this method is only 64 bits. Therefore, it should not be considered collision-resistant.

See also

Clone this wiki locally