Class: Hyperll::MurmurHash

Inherits:
Object
  • Object
show all
Defined in:
lib/hyperll/murmur_hash.rb

Overview

Constant Summary collapse

INT_MASK =
0xFFFFFFFF
LONG_MASK =
0xFFFFFFFFFFFFFFFF

Class Method Summary collapse

Class Method Details

.hash(obj) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/hyperll/murmur_hash.rb', line 7

def self.hash(obj)
  if Integer === obj
    hash_int(obj)
  else
    hash_string(obj.to_s)
  end
end

.hash64(obj) ⇒ Object



95
96
97
# File 'lib/hyperll/murmur_hash.rb', line 95

def self.hash64(obj)
  return hash64_str(obj.to_s)
end