metropolis.git  about / heads / tags
key-value store for Rack
blob 69b2819bb6bae1239c786c0b8f36a4c71841dd8b 266 bytes (raw)
$ git show HEAD:lib/metropolis/multi_hash/to_i.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 
# -*- encoding: binary -*-
# simple "hashing" method which converts keys to integers,
# this may be useful for databases that only store numeric keys
module Metropolis::MultiHash::ToI
  def to_i(key)
    key.to_i
  end

  def to_i_16(key)
    key.to_i(16)
  end
end

git clone https://yhbt.net/metropolis.git