ZENOTME commented on code in PR #84:
URL: https://github.com/apache/datasketches-rust/pull/84#discussion_r2778811362


##########
datasketches/src/hash/mod.rs:
##########
@@ -37,6 +37,19 @@ pub(crate) use self::xxhash::XxHash64;
 /// a history of stored sketches you are stuck with it.
 pub(crate) const DEFAULT_UPDATE_SEED: u64 = 9001;
 
+/// Computes and checks the 16-bit seed hash from the given long seed.
+///
+/// The seed hash may not be zero in order to maintain compatibility with 
older serialized
+/// versions that did not have this concept.

Review Comment:
   So do we need to return an error here for the result is 0 as Java:
   ```
     public static short computeSeedHash(final long seed) {
       final long[] seedArr = {seed};
       final short seedHash = (short)(hash(seedArr, 0L)[0] & 0xFFFFL);
       if (seedHash == 0) {
         throw new SketchesArgumentException(
             "The given seed: " + seed + " produced a seedHash of zero. "
                 + "You must choose a different seed.");
       }
       return seedHash;
     }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to