From: "Mateus .." Date: 2011-05-15T15:33:07+09:00 Subject: Re: search nearest to elements in array (hash) thank you guys! i really appreciate this. i'm sorry if my question wasn't understandable. main reason for this purpose is consistent hashing, where we need to find for example next bigger key in array comparing to the "needle". i haven't tested yet your solutions but i will. hope this topic helps for someone in future. i'm also googled and find this: https://github.com/superfeedr/consistent_hashr/blob/master/lib/consistent_hashr.rb but i'm not sure that this is efficient way of doing things if we have for example 10k elements in array. -- Posted via http://www.ruby-forum.com/.