Sha256: 772fc00a383a443a687cdef4e90d721f554c2878d64696316b9477168d0ae450
Contents?: true
Size: 569 Bytes
Versions: 9
Compression:
Stored size: 569 Bytes
Contents
require "base32" module Fling # Encoder/decoder for z-base-32 used by Tahoe-LAFS module Encoding module_function # Encode a string in z-base-32 # # @param string [String] arbitrary string to be encoded # @return [String] lovely, elegant z-base-32 def encode(string) Base32.encode(string).downcase.sub(/=+$/, "") end # Decode a z-base-32 string # # @param string [String] z-base-32 string to be decoded # @return [String] decoded string def decode(string) Base32.decode(string.upcase) end end end
Version data entries
9 entries across 9 versions & 1 rubygems