module Blurhash::Base83

Constants

DIGIT_CHARACTERS

Public Class Methods

decode83(str) click to toggle source
# File lib/blurhash.rb, line 43
def self.decode83(str)
  value = 0

  str.each_char.with_index do |c, i|
    digit = DIGIT_CHARACTERS.find_index(c)
    value = value * 83 + digit
  end

  value
end