Skip to content

Instantly share code, notes, and snippets.

@paul
Created October 3, 2008 18:41
Show Gist options
  • Save paul/14611 to your computer and use it in GitHub Desktop.
Save paul/14611 to your computer and use it in GitHub Desktop.
irb(main):009:0> id = 2 ** 256
=> 115792089237316195423570985008687907853269984665640564039457584007913129639936
irb(main):010:0> things[[id]]
=> nil
irb(main):014:0> id = UUID.random_create
=> #<UUID:0x-2422d154 UUID:dc6d7b50-5720-425f-933d-6c9eb005208e>
irb(main):015:0> things[[id]]
RangeError: bignum too big to convert into `long'
from (irb):15:in `hash'
from (irb):15:in `[]'
from (irb):15
irb(main):016:0> things[[id.hash]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment