From 671512b96cacd44e77fd96dcf9e980475c8d669a Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sat, 31 Dec 2016 19:53:43 +0200 Subject: [PATCH] avoid fixnum overflow for hashes --- lib/typed/parfait/type.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/typed/parfait/type.rb b/lib/typed/parfait/type.rb index 883f2c9e..e1104923 100644 --- a/lib/typed/parfait/type.rb +++ b/lib/typed/parfait/type.rb @@ -190,7 +190,7 @@ module Parfait hash_code += item_hash + (item_hash / 256 ) * index index += 1 end - hash_code + hash_code % (2 ** 62) end def self.str_hash(str)