Skip to content

Commit

Permalink
updated documentation of XXH3_64bits_reset_withSecretandSeed()
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyan4973 committed May 8, 2024
1 parent 8e483e4 commit d622b4f
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions xxhash.h
Original file line number Diff line number Diff line change
Expand Up @@ -1975,13 +1975,6 @@ XXH3_64bits_withSecretandSeed(XXH_NOESCAPE const void* data, size_t len,
* @return @ref XXH_ERROR on failure.
*
* @see XXH3_64bits_withSecretandSeed(): contract is the same.
*
* Note: there was a bug in an earlier version of this function (<= v0.8.2)
* that would make it generate an incorrect hash value
* when @p seed == 0 and @p length < XXH3_MIDSIZE_MAX.
* As stated in the contract, the correct hash result must be
* the same as XXH3_128bits_withSeed() when @p length < XXH3_MIDSIZE_MAX.
* Results generated by this older version are not considered comparable.
*/
XXH_PUBLIC_API XXH_PUREF XXH128_hash_t
XXH3_128bits_withSecretandSeed(XXH_NOESCAPE const void* input, size_t length,
Expand All @@ -2000,12 +1993,13 @@ XXH3_128bits_withSecretandSeed(XXH_NOESCAPE const void* input, size_t length,
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* @see XXH3_64bits_withSecretandSeed()
* @see XXH3_64bits_withSecretandSeed(). Contract is identical.
*/
XXH_PUBLIC_API XXH_errorcode
XXH3_64bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr,
XXH_NOESCAPE const void* secret, size_t secretSize,
XXH64_hash_t seed64);

/*!
* @brief Resets an @ref XXH3_state_t with secret data to begin a new hash.
*
Expand All @@ -2017,12 +2011,21 @@ XXH3_64bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr,
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* @see XXH3_64bits_withSecretandSeed()
* @see XXH3_64bits_withSecretandSeed(). Contract is identical.
*
* Note: there was a bug in an earlier version of this function (<= v0.8.2)
* that would make it generate an incorrect hash value
* when @p seed == 0 and @p length < XXH3_MIDSIZE_MAX
* and @p secret is different from XXH3_generateSecret_fromSeed().
* As stated in the contract, the correct hash result must be
* the same as XXH3_128bits_withSeed() when @p length <= XXH3_MIDSIZE_MAX.
* Results generated by this older version are wrong, hence not comparable.
*/
XXH_PUBLIC_API XXH_errorcode
XXH3_128bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr,
XXH_NOESCAPE const void* secret, size_t secretSize,
XXH64_hash_t seed64);

#endif /* !XXH_NO_STREAM */

#endif /* !XXH_NO_XXH3 */
Expand Down

0 comments on commit d622b4f

Please sign in to comment.