Developer Reference

  • 2020
  • 07/15/2020
  • Public Content
Contents

Hash

DEPRECATED. Calculates the hash value for the string.

Syntax

IppStatus ippsHash_8u32u(const Ipp8u*
pSrc
, int
len
, Ipp32u*
pHashVal
);
IppStatus ippsHash_16u32u(const Ipp16u*
pSrc
, int
len
, Ipp32u*
pHashVal
);
IppStatus ippsHashSJ2_8u32u(const Ipp8u*
pSrc
, int
len
, Ipp32u*
pHashVal
);
IppStatus ippsHashSJ2_16u32u(const Ipp16u*
pSrc
, int
len
, Ipp32u*
pHashVal
);
IppStatus ippsHashMSCS_8u32u(const Ipp8u*
pSrc
, int
len
, Ipp32u*
pHashVal
);
IppStatus ippsHashMSCS_16u32u(const Ipp16u*
pSrc
, int
len
, Ipp32u*
pHashVal
);
Include Files
ippch.h
Domain Dependencies
Headers:
ippcore.h
,
ippvm.h
,
ipps.h
Libraries:
ippcore.lib
,
ippvm.lib
,
ipps.lib
Parameters
pSrc
Pointer to the source string.
len
Number of elements in the string.
pHashVal
Pointer to the result value.
Description
This function is deprecated and will be removed in a future release. If you have concerns, open a ticket and provide feedback at https://supporttickets.intel.com/.
This function produces the hash value
pHasVal
for the specified string
pSrc
. The hash value is fairly unique to the given string. If hash values of two strings are different, the strings are different as well. If the hush values are the same, the strings are probably identical. The hash value is calculated in the following manner: initial value is set to 0, then the hash value is calculated successively for each
i
-th string element as
pHashVal
[i] = 2*
pHashVal
[i-1]^
pSrc
[i]
, where
^
denotes a bitwise exclusive OR (XOR) operator. The hash value for the last element is the hash value for the whole string.
Return Values
ippStsNoErr
Indicates no error.
ippStsNullPtrErr
Indicates an error condition if one of the specified pointers is
NULL
.
ippStsLengthErr
Indicates an error condition if
len
is negative.

Example

The code example below shows how to use the functions
ippsHash_8u32u
,
ippsHashSJ2_8u32u
, and
ippsHashMSCS_8u32u
.
Ipp8u string[] = "monkey";
Ipp32u hash;
hash = 0;
ippsHash_8u32u( string, sizeof (string) - 1, &hash );
printf ( "ippsHash_8u32u hash value: %u\n", hash );
hash = 0;
ippsHashSJ2_8u32u( string, sizeof (string) - 1, &hash );
printf ( "ippsHashSJ2_8u32u hash value: %u\n", hash );
hash = 0;
ippsHashMSCS_8u32u( string, sizeof (string) - 1, &hash );
printf ( "ippsHashMSCS_8u32u hash value: %u\n", hash );
Output:
ippsHash_8u32u hash value: 2367
ippsHashSJ2_8u32u hash value: 3226471379
ippsHashMSCS_8u32u hash value: 1466279646

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804