Module: Util
- Defined in:
- lib/record-locator-util.rb
Defined Under Namespace
Classes: Base
Constant Summary collapse
- ENCODER =
Hash.new do |h,k| h[k] = Hash[ k.chars.map.enum_for(:each_with_index).to_a.map(&:reverse) ] end
- DECODER =
Hash.new do |h,k| h[k] = Hash[ k.chars.map.enum_for(:each_with_index).to_a ] end
- BASE27 =
0 through 9 plus A through Z, without B8S5O0I1 or Q. “234679ACDEFGHJKLMNPRTUVWXYZ”
(('0'..'9').to_a + ('A'..'Z').to_a).delete_if{|char| char =~ /[B8S5O0I1Q]/}.join