code_junkie

How to generate a hash value in J2ME

Nov 13th, 2011
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. public int hashCode() {
  2. int result = 17;
  3. for (int i = 0; i < array.length; i++) {
  4. result = 31*result + (int)array[i];
  5. }
  6. return result;
  7. }
  8.  
  9. new HashCodeBuilder().append(bytes).toHashCode();
Add Comment
Please, Sign In to add comment