|
400 | 400 | hashing algorithm functor. All of the hashing algorithm functors in 'bslh'
|
401 | 401 | have the function signature shown below:
|
402 | 402 | ..
|
| 403 | + /// Incorporates the specified `data` of `length` bytes into the internal |
| 404 | + /// state of the hashing algorithm. |
403 | 405 | void operator()(const char *data, size_t length);
|
404 |
| - // Incorporates the specified 'data' of 'length' bytes into the internal |
405 |
| - // state of the hashing algorithm. |
406 | 406 | ..
|
407 | 407 | As we can see, the hashing algorithm functor takes a pointer to the start of
|
408 | 408 | the data and a length in bytes. To hash a C-String, we call the hashing
|
|
889 | 889 | /Component Overview
|
890 | 890 | /------------------
|
891 | 891 | This section provides a brief introduction to each of the components in the
|
892 |
| - 'bslh' package. Full details are available in the documentation of each |
| 892 | + `bslh` package. Full details are available in the documentation of each |
893 | 893 | component.
|
894 | 894 |
|
895 |
| -/'bslh_defaulthashalgorithm' |
896 |
| -/- - - - - - - - - - - - - - |
897 |
| - The 'bslh_defaulthashalgorithm' component provides an unspecified default |
| 895 | +/bslh_defaulthashalgorithm |
| 896 | +/- - - - - - - - - - - - - |
| 897 | + The `bslh_defaulthashalgorithm` component provides an unspecified default |
898 | 898 | hashing algorithm. The supplied algorithm is suitable for general purpose use
|
899 | 899 | in a hash table. The underlying algorithm is subject to change in future
|
900 | 900 | releases.
|
901 | 901 |
|
902 |
| - This class satisfies the requirements for regular 'bslh' hashing algorithms, |
903 |
| - as defined in 'bslh_hash'. |
| 902 | + This class satisfies the requirements for regular `bslh` hashing algorithms, |
| 903 | + as defined in `bslh_hash`. |
904 | 904 |
|
905 |
| -/'bslh_defaultseededhashalgorithm' |
906 |
| -/- - - - - - - - - - - - - - - - - |
907 |
| - The 'bslh_defaultseededhashalgorithm' component provides an unspecified |
| 905 | +/bslh_defaultseededhashalgorithm |
| 906 | +/- - - - - - - - - - - - - - - - |
| 907 | + The `bslh_defaultseededhashalgorithm` component provides an unspecified |
908 | 908 | default seeded hashing algorithm. The supplied algorithm is suitable for
|
909 | 909 | general purpose use in a hash table. The underlying algorithm is subject to
|
910 | 910 | change in future releases.
|
911 | 911 |
|
912 |
| - This class satisfies the requirements for seeded 'bslh' hashing algorithms, as |
913 |
| - defined in 'bslh_seededhash'. |
| 912 | + This class satisfies the requirements for seeded `bslh` hashing algorithms, as |
| 913 | + defined in `bslh_seededhash`. |
914 | 914 |
|
915 |
| -/'bslh_hash' |
916 |
| -/- - - - - - |
917 |
| - The {'bslh_hash'} component provides a templated 'struct', 'bslh::Hash', which |
| 915 | +/bslh_hash |
| 916 | +/- - - - - |
| 917 | + The `bslh_hash` component provides a templated `struct`, `bslh::Hash`, which |
918 | 918 | provides hashing functionality. This struct is a drop in replacement for
|
919 |
| - 'bsl::hash'. 'bslh::Hash' is a wrapper that adapts hashing algorithms from |
920 |
| - 'bslh' and 'hashAppend' free functions to match the interface of 'bsl::hash'. |
921 |
| - This component also contains 'hashAppend' definitions for fundamental types, |
922 |
| - which are required to make the hashing algorithms in 'bslh' work. |
923 |
| - |
924 |
| -/'bslh_seededhash' |
925 |
| -/- - - - - - - - - |
926 |
| - The {'bslh_seededhash'} component provides a templated struct, |
927 |
| - 'bslh::SeededHash', which provides hashing functionality. This 'struct' is a |
928 |
| - drop in replacement for 'bsl::hash'. It is similar to 'bslh::Hash', however, |
| 919 | + `bsl::hash`. `bslh::Hash` is a wrapper that adapts hashing algorithms from |
| 920 | + `bslh` and `hashAppend` free functions to match the interface of `bsl::hash`. |
| 921 | + This component also contains `hashAppend` definitions for fundamental types, |
| 922 | + which are required to make the hashing algorithms in `bslh` work. |
| 923 | + |
| 924 | +/bslh_seededhash |
| 925 | +/- - - - - - - - |
| 926 | + The `bslh_seededhash` component provides a templated struct, |
| 927 | + `bslh::SeededHash`, which provides hashing functionality. This `struct` is a |
| 928 | + drop in replacement for `bsl::hash`. It is similar to `bslh::Hash`, however, |
929 | 929 | it is meant for hashes that require a seed. It takes a seed generator and
|
930 |
| - uses that to create seeds to give the hashing algorithm. 'bslh::SeededHash' |
931 |
| - is a wrapper which adapts hashing algorithms from 'bslh' to match the |
932 |
| - interface of 'bsl::hash'. 'bslh::SeededHash' is a universal hashing functor |
933 |
| - that will hash any type that implements 'hashAppend' using the hashing |
| 930 | + uses that to create seeds to give the hashing algorithm. `bslh::SeededHash` |
| 931 | + is a wrapper which adapts hashing algorithms from `bslh` to match the |
| 932 | + interface of `bsl::hash`. `bslh::SeededHash` is a universal hashing functor |
| 933 | + that will hash any type that implements `hashAppend` using the hashing |
934 | 934 | algorithm provided as a template parameter.
|
935 | 935 |
|
936 |
| -/'bslh_seedgenerator' |
937 |
| -/ - - - - - - - - - - |
938 |
| - The {'bslh_seedgenerator'} component provides a class, 'bslh::SeedGenerator', |
| 936 | +/bslh_seedgenerator |
| 937 | +/ - - - - - - - - - |
| 938 | + The `bslh_seedgenerator` component provides a class, `bslh::SeedGenerator`, |
939 | 939 | which utilizes a user-supplied random number generator (RNG) to generate
|
940 | 940 | arbitrary length seeds. The quality of the seeds will only be as good as the
|
941 | 941 | quality of the supplied RNG. A cryptographically secure RNG must be supplied
|
942 |
| - in order for 'SeedGenerator' to produce seeds suitable for a cryptographically |
| 942 | + in order for `SeedGenerator` to produce seeds suitable for a cryptographically |
943 | 943 | secure algorithm.
|
944 | 944 |
|
945 | 945 | This class satisfies the requirements for a seed generator, as defined in
|
946 |
| - 'bslh_seededhash'. |
| 946 | + `bslh_seededhash`. |
947 | 947 |
|
948 |
| -/'bslh_siphashalgorithm' |
949 |
| -/- - - - - - - - - - - - |
950 |
| - The 'bslh_siphashalgorithm' component provides an implementation of the |
| 948 | +/bslh_siphashalgorithm |
| 949 | +/- - - - - - - - - - - |
| 950 | + The `bslh_siphashalgorithm` component provides an implementation of the |
951 | 951 | SipHash algorithm. SipHash is an algorithm designed for speed and security.
|
952 | 952 | A primary use case for this algorithm is to provide an extra line of defense
|
953 |
| - in hash tables (such as the underlying implementation of 'unordered_map') |
| 953 | + in hash tables (such as the underlying implementation of `unordered_map`) |
954 | 954 | against malicious input that could cause Denial of Service (DoS) attacks. It
|
955 | 955 | is based on one of the finalists for the SHA-3 cryptographic hash standard.
|
956 | 956 | Full details of the hash function can be found here:
|
957 |
| - '{https://131002.net/siphash/siphash.pdf}'. This particular implementation |
958 |
| - has been derived from 'siphash.h' in Howard Hinnant's work here: |
959 |
| - '{https://github.com/HowardHinnant/hash_append}' and as much of the original |
| 957 | + https://131002.net/siphash/siphash.pdf. This particular implementation |
| 958 | + has been derived from `siphash.h` in Howard Hinnant's work here: |
| 959 | + https://github.com/HowardHinnant/hash_append and as much of the original |
960 | 960 | code as possible, including comment headers, has been preserved.
|
961 | 961 |
|
962 |
| - This class satisfies the requirements for seeded 'bslh' hashing algorithms, as |
963 |
| - defined in 'bslh_seededhash'. |
| 962 | + This class satisfies the requirements for seeded `bslh` hashing algorithms, as |
| 963 | + defined in `bslh_seededhash`. |
964 | 964 |
|
965 |
| -/'bslh_spookyhashalgorithm' |
966 |
| -/ - - - - - - - - - - - - - |
967 |
| - The 'bslh_spookyhashalgorithm' component provides an implementation of the |
| 965 | +/bslh_spookyhashalgorithm |
| 966 | +/ - - - - - - - - - - - - |
| 967 | + The `bslh_spookyhashalgorithm` component provides an implementation of the |
968 | 968 | SpookyHash algorithm by Bob Jenkins. This algorithm is a general purpose
|
969 | 969 | algorithm that is known to quickly reach good avalanche performance and
|
970 | 970 | execute in time that is comparable to or faster than other industry standard
|
971 | 971 | algorithms such as CityHash. It is a good default choice for hashing values
|
972 | 972 | in unordered associative containers. For more information, see
|
973 |
| - 'http://burtleburtle.net/bob/hash/spooky.html'. |
| 973 | + http://burtleburtle.net/bob/hash/spooky.html. |
974 | 974 |
|
975 |
| - This class satisfies the requirements for regular 'bslh' hashing algorithms |
976 |
| - and seeded 'bslh' hashing algorithms, as defined in 'bslh_hash' and |
977 |
| - 'bslh_seededhash' respectively. |
| 975 | + This class satisfies the requirements for regular `bslh` hashing algorithms |
| 976 | + and seeded `bslh` hashing algorithms, as defined in `bslh_hash` and |
| 977 | + `bslh_seededhash` respectively. |
978 | 978 |
|
979 |
| -/'bslh_spookyhashalgorithmimp' |
980 |
| -/- - - - - - - - - - - - - - - |
981 |
| - The 'bslh_spookyhashalgorithmimp' component provides BDE-style encapsulation |
| 979 | +/bslh_spookyhashalgorithmimp |
| 980 | +/- - - - - - - - - - - - - - |
| 981 | + The `bslh_spookyhashalgorithmimp` component provides BDE-style encapsulation |
982 | 982 | of Bob Jenkins canonical SpookyHash implementation. SpookyHash provides a way
|
983 | 983 | to hash contiguous data all at once, or non-contiguous data in pieces. More
|
984 |
| - information is available at 'http://burtleburtle.net/bob/hash/spooky.html'. |
| 984 | + information is available at http://burtleburtle.net/bob/hash/spooky.html. |
985 | 985 |
|
986 |
| -/'bslh_wyhashincrementalalgorithm' |
987 |
| -/- - - - - - - - - - - - - - - - - |
988 |
| - The 'WyHash' algorithm, 'wyhash_final_version_3' with the 'incremental' |
| 986 | +/bslh_wyhashincrementalalgorithm |
| 987 | +/- - - - - - - - - - - - - - - - |
| 988 | + The `WyHash` algorithm, `wyhash_final_version_3` with the `incremental` |
989 | 989 | property added, meaning that hashing a segment in a single pass will yield the
|
990 | 990 | same result as hashing it in contiguous pieces, but, unlike the original
|
991 |
| - 'WyHash', this algorithm yields different results depending on the byte order |
| 991 | + `WyHash`, this algorithm yields different results depending on the byte order |
992 | 992 | of the host.
|
0 commit comments