remove constant warning in base62 file
This commit is contained in:
parent
f674b9e86e
commit
24dcfc2db5
|
@ -1,9 +1,9 @@
|
||||||
# Modified version of: https://github.com/steventen/base62-rb
|
# Modified version of: https://github.com/steventen/base62-rb
|
||||||
|
|
||||||
module Base62
|
module Base62
|
||||||
KEYS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".freeze
|
KEYS ||= "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".freeze
|
||||||
KEYS_HASH = KEYS.each_char.with_index.inject({}) { |h, (k, v)| h[k] = v; h }
|
KEYS_HASH ||= KEYS.each_char.with_index.to_h
|
||||||
BASE = KEYS.length
|
BASE ||= KEYS.length
|
||||||
|
|
||||||
# Encodes base10 (decimal) number to base62 string.
|
# Encodes base10 (decimal) number to base62 string.
|
||||||
def self.encode(num)
|
def self.encode(num)
|
||||||
|
|
Loading…
Reference in New Issue