0

I saw that java can't handle unsigned long... If yes, can any one post the code? Thanks.

I82Much
  • 26,901
  • 13
  • 88
  • 119
xmurobi
  • 439
  • 1
  • 8
  • 11

1 Answers1

2

Are you going to be interoperating with languages featuring unsigned types? If not you can probably just use the standard java long without a problem. It will probably overflow anyways (as per the discussion here djb2 Hash Function) but that's not a problem.

Here's a PermissionSet class in the wild using this implementation. Don't forget that a hashCode in Java needs to return an integer anyways, so the lack of an unsigned long should not make a difference - there will just be fewer possible values that the function takes on.

Community
  • 1
  • 1
I82Much
  • 26,901
  • 13
  • 88
  • 119