A platform for community discussion. Free, open, simple.
remove constant warning in base62 file
Régis Hanol24dcfc2db5a1
diff --git a/lib/base62.rb b/lib/base62.rbindex 84f9fbf23c8..bec48359aa9 100644--- a/lib/base62.rb+++ b/lib/base62.rb@@ -1,9 +1,9 @@# Modified version of: https://github.com/steventen/base62-rbmodule Base62- KEYS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".freeze- KEYS_HASH = KEYS.each_char.with_index.inject({}) { |h, (k, v)| h[k] = v; h }- BASE = KEYS.length+ KEYS ||= "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".freeze+ KEYS_HASH ||= KEYS.each_char.with_index.to_h+ BASE ||= KEYS.length# Encodes base10 (decimal) number to base62 string.def self.encode(num)