Sha256: fcce40cf4b8979ba6be8f28297b1b7215aec9ba2ce608a69dfda86c9340f398a

Contents?: true

Size: 1.4 KB

Versions: 28

Compression:

Stored size: 1.4 KB

Contents

# Base64

The Base64 module provides for the encoding (`#encode64`, `#strict_encode64`,
`#urlsafe_encode64`) and decoding (`#decode64`, `#strict_decode64`,
`#urlsafe_decode64`) of binary data using a Base64 representation.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'base64'
```

And then execute:

    $ bundle install

Or install it yourself as:

    $ gem install base64

## Usage

A simple encoding and decoding.

```ruby
require "base64"

enc   = Base64.encode64('Send reinforcements')
                    # -> "U2VuZCByZWluZm9yY2VtZW50cw==\n"
plain = Base64.decode64(enc)
                    # -> "Send reinforcements"
```

The purpose of using base64 to encode data is that it translates any
binary data into purely printable characters.

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/base64.

Version data entries

28 entries across 28 versions & 9 rubygems

Version Path
acfs-2.0.0 vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/README.md
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/base64-0.2.0/README.md
base64-0.1.2 README.md
moneykit-0.1.15 vendor/bundle/ruby/3.2.0/gems/base64-0.2.0/README.md
moneykit-0.1.14 vendor/bundle/ruby/3.2.0/gems/base64-0.2.0/README.md
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/base64-0.2.0/README.md
moneykit-0.1.13 vendor/bundle/ruby/3.2.0/gems/base64-0.2.0/README.md
moneykit-0.1.12 vendor/bundle/ruby/3.2.0/gems/base64-0.2.0/README.md
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/base64-0.2.0/README.md
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/base64-0.2.0/README.md
moneykit-0.1.11 vendor/bundle/ruby/3.2.0/gems/base64-0.2.0/README.md
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/base64-0.2.0/README.md
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/base64-0.2.0/README.md
moneykit-0.1.10 vendor/bundle/ruby/3.2.0/gems/base64-0.2.0/README.md
moneykit-0.1.9 vendor/bundle/ruby/3.2.0/gems/base64-0.2.0/README.md
moneykit-0.1.6 vendor/bundle/ruby/3.2.0/gems/base64-0.2.0/README.md
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/base64-0.2.0/README.md
moneykit-0.1.5 vendor/bundle/ruby/3.2.0/gems/base64-0.2.0/README.md
moneykit-0.1.4 vendor/bundle/ruby/3.2.0/gems/base64-0.2.0/README.md
moneykit-0.1.3 vendor/bundle/ruby/3.2.0/gems/base64-0.2.0/README.md