aherbert commented on issue #27: Murmur3fix
URL: https://github.com/apache/commons-codec/pull/27#issuecomment-554649535
 
 
   In the case of hash32 I would deprecate those that are known to be broken 
but not the ones that are not (i.e. the convenience methods). Then provide the 
new hash32x86 method and delegate calls to a single implementation to eliminate 
code duplication.
   
   For the hash128x64 method this seems to be the easy solution:
   
   ```
   // Current
   public static long[] hash128(final byte[] data, final int offset, final int 
length, final int seed) {
       return hash128x64(data, offset, length, seed, seed);
   }
   
   // New
   public static long[] hash128x64(final byte[] data, final int offset, final 
int length, final int seed) {
       return hash128x64(data, offset, length, seed & 0xffffffffL, seed & 
0xffffffffL);
   }
   
   // Single implementation
   private static long[] hash128x64(final byte[] data, final int offset, final 
int length,
           final long h1, final long h2) {
       ...
   ```
   
   Would that work?
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to