module Ronin::Support::Encoding::Base32
Base32
encoding.
## Core-Ext Methods
-
{String#base32_encode}
-
{String#base32_decode}
@see datatracker.ietf.org/doc/html/rfc3548#page-6
@api public
@since 1.0.0
Constants
- TABLE
-
Base32
alphabet@api private
Public Class Methods
Source
# File lib/ronin/support/encoding/base32.rb, line 65 def self.decode(data) decoded = String.new(encoding: Encoding::UTF_8) each_chunk(data,8) do |chunk| chunk.decode(decoded) end return decoded end
Base32
decodes the given String
.
@param [String] data
The String to decode.
@return [String]
The Base32 decoded String.
Source
# File lib/ronin/support/encoding/base32.rb, line 170 def self.each_chunk(data,size) data.bytes.each_slice(size) do |byte_slice| yield Chunk.new(byte_slice) end end
Enumerates over the consecutive chunks within the given data.
@param [String] data
@param [Integer] size
@yield [chunk]
@yieldparam [Chunk] chunk
@api private