C# to Ruby how to Base64 Encode
Today I needed to Base64 encode a string, so this was a great opportunity to learn how you would do this in Ruby vs. C#
Let’s look at the C# way to do this
So I need a using to System.Text, I need to get the string as bytes and the I can convert it to a base64 encoded string.
Now how do I do this in Ruby?
WAT!?!? I need the a require to base64 and then I can call Base64.encode64, there is not much more to say other than wow. Ruby again is saving me a whole bunch of keystrokes, and I don’t need to write any extension method this is all baked into the framework.
I’m not totally surprised that this was easier in Ruby however I am amazed at how much easier my life is when using Ruby.