Skip to main content

Hashing Data in C

Hashing Data in C

The Hash() function is used to hash a single data. The usage of Hash() is straightforward as shown in the following example. Notice that the use of this function does not require a connection to a key service.


Code Samples

See the C environment settings for details on setting the project environment.


c_hash.c

The complete source for this sample, together with its console output, is published in the SDK reference and is the maintained copy:

c_hash.c

Output
Source Data: This is a test string
Salt : this is our secret
Return value = 0
Length of hash value = 28
Hashed value : h1S1Tcdvrj9UUGEpua/Kd6oZIKc=