module Addressable::IDNA

def self.punycode_decode_digit(codepoint)

base - 1, or PUNYCODE_BASE if codepoint does not represent a value.
(for use in representing integers) in the range 0 to
Returns the numeric value of a basic codepoint
def self.punycode_decode_digit(codepoint)
  if codepoint - 48 < 10
    codepoint - 22
  elsif codepoint - 65 < 26
    codepoint - 65
  elsif codepoint - 97 < 26
    codepoint - 97
  else
    PUNYCODE_BASE
  end
end