Sha256: 94724a7f7f6c8cf171ab360926fbd0511f87a7aefea9a2cfd98819b4f204c40c
Contents?: true
Size: 170 Bytes
Versions: 8
Compression:
Stored size: 170 Bytes
Contents
module Kraps class HashPartitioner def call(key, num_partitions) Digest::SHA1.hexdigest(JSON.generate(key))[0..4].to_i(16) % num_partitions end end end
Version data entries
8 entries across 8 versions & 1 rubygems