8#ifndef INCLUDED_BSLH_HASH
9#define INCLUDED_BSLH_HASH
490#include <bslscm_version.h>
539template <
class HASH_ALGORITHM>
547 HASH_ALGORITHM d_hashAlgorithm;
561 void operator()(
const void *input,
size_t numBytes);
565 template <
class ELEMENT_TYPE>
566 void operator()(
const ELEMENT_TYPE *input,
size_t numBytes);
579template <
class HASH_ALGORITHM = bslh::DefaultHashAlgorithm>
615 template <
class TYPE>
630template <
class HASH_ALGORITHM,
class TYPE>
640 hashAlg(&input,
sizeof(input));
652template <
class HASH_ALGORITHM,
class TYPE>
662 hashAlg(&input,
sizeof(input));
671template <
class HASH_ALGORITHM,
class TYPE>
673hashAppend(HASH_ALGORITHM& hashAlg, TYPE input);
681template <
class HASH_ALGORITHM,
class TYPE>
683hashAppend(HASH_ALGORITHM& hashAlg, TYPE input);
692template <
class HASH_ALGORITHM,
size_t N>
699template <
class HASH_ALGORITHM,
size_t N>
700void hashAppend(HASH_ALGORITHM& hashAlg,
const char (&input)[N]);
711template <
class HASH_ALGORITHM,
class TYPE,
size_t N>
719template <
class HASH_ALGORITHM,
class TYPE,
size_t N>
720void hashAppend(HASH_ALGORITHM& hashAlg,
const TYPE (&input)[N]);
733template <
class HASH_ALGORITHM>
740template <
class HASH_ALGORITHM>
745 d_hashAlgorithm(input, numBytes);
748template <
class HASH_ALGORITHM>
749template <
class ELEMENT_TYPE>
752 const ELEMENT_TYPE *input,
755 d_hashAlgorithm(input, numBytes);
758template <
class HASH_ALGORITHM>
763 return d_hashAlgorithm.computeHash();
771template <
class HASH_ALGORITHM>
800template <
class HASH_ALGORITHM,
class TYPE>
810 unsigned char normalizedData = !!input;
812 hashAlg(
static_cast<void *
>(&normalizedData),
sizeof(normalizedData));
815template <
class HASH_ALGORITHM,
class TYPE>
824#if (defined BSLS_PLATFORM_CPU_X86 || defined BSLS_PLATFORM_CPU_X86_64) && \
825 (defined BSLS_PLATFORM_CMP_GNU || defined BSLS_PLATFORM_CMP_CLANG)
881 #if !defined(BSLS_PLATFORM_CMP_CLANG) && BSLS_PLATFORM_CPU_X86_64
890 hashAlg(&input,
sizeof(input));
894 hashAlg(&input,
sizeof(input) > 10 ? 10 : sizeof(input));
896 hashAlg(&input,
sizeof(input));
900template <
class HASH_ALGORITHM,
size_t N>
904 hashAlg(&input,
sizeof(
char)*N);
907template <
class HASH_ALGORITHM,
size_t N>
911 hashAlg(&input,
sizeof(
char)*N);
914template <
class HASH_ALGORITHM,
class TYPE,
size_t N>
919 for (
size_t i = 0; i < N; ++i) {
925template <
class HASH_ALGORITHM,
class TYPE,
size_t N>
929 for (
size_t i = 0; i < N; ++i) {
Definition bslh_defaulthashalgorithm.h:346
result_type computeHash()
Definition bslh_defaulthashalgorithm.h:428
Definition bslh_hash.h:540
HASH_ALGORITHM::result_type result_type
Definition bslh_hash.h:543
result_type computeHash()
Definition bslh_hash.h:761
void operator()(const void *input, size_t numBytes)
Definition bslh_hash.h:742
Hash_AdlWrapper()
Definition bslh_hash.h:735
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlb_printmethods.h:283
Definition bslh_defaulthashalgorithm.h:339
bsl::enable_if<(bsl::is_integral< TYPE >::value||bsl::is_pointer< TYPE >::value||bsl::is_enum< TYPE >::value)&&!bsl::is_same< TYPE, bool >::value >::type hashAppend(HASH_ALGORITHM &hashAlg, TYPE input)
Definition bslh_hash.h:638
Definition bdlbb_blob.h:576
Definition bslmf_enableif.h:525
Definition bslmf_isenum.h:270
Definition bslmf_isfloatingpoint.h:134
Definition bslmf_isintegral.h:130
Definition bslmf_ispointer.h:138
Definition bslmf_issame.h:146
Definition bslmf_istriviallycopyable.h:329
Definition bslmf_istriviallydefaultconstructible.h:293
Definition bslh_hash.h:580
result_type operator()(const TYPE &type) const
~Hash()=default
Destroy this object.
Hash & operator=(const Hash &rhs)=default
Hash(const Hash &original)=default
size_t result_type
Definition bslh_hash.h:586
HASH_ALGORITHM HashAlgorithm
Make the HASH_ALGORITHM template parameter available to clients.
Definition bslh_hash.h:589
Definition bslmf_isbitwisemoveable.h:718