Base64encoding

Created for the course "Stack of programming technologies" V. N. Karazin Kharkiv National University

Ruby 3.3.5 Base64encoding gem.


A gem for Base64 encoding and decoding.

This gem has methods:

  • encode_base64 - method that encodes UTF-8 strings to base64 (UTF-8) string
  • decode_base64 - method that decodes base64 string to UTF-8 string.

Installation

Install the gem and add to the application's Gemfile by executing:

bundle add Base64encoding

If bundler is not being used to manage dependencies, install the gem by executing:

gem install Base64encoding

Usage

require 'Base64encoding'

push(Base64encoding.encode_base64('Hello, World!'))
# "SGVsbG8sIFdvcmxkIQ=="

push(Base64encoding.decode_base64('SGVsbG8sIFdvcmxkIQ=='))
# "Hello, World!"

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/Base64encoding.