Sha256: b5cd1f992d87cecd6b94b72f4aacfdcb7a4dc41cfbecf5ff4092835e7e174ac6
Contents?: true
Size: 375 Bytes
Versions: 9
Compression:
Stored size: 375 Bytes
Contents
# frozen_string_literal: false module Kiev module Base52 KEYS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".freeze BASE = KEYS.length def self.encode(num) return KEYS[0] if num == 0 return nil if num < 0 str = "" while num > 0 str.prepend(KEYS[num % BASE]) num /= BASE end str end end end
Version data entries
9 entries across 9 versions & 1 rubygems