Forum: Ruby Ruby's standard module "Base64"

Posted by Pritam Dey (pritamdey)
on 2013-03-07 21:45
Hi All,

Could anyone help me here to understand when we need to consider the
below 4 methods:

strict_decode64(str)
strict_encode64(bin)
urlsafe_encode64(bin)
urlsafe_decode64(str)

From the doc also I didn't get any examples. So examples with
explanation might be helpful for me to understand.


Thanks in advance
Posted by Matthew Kerwin (mattyk)
on 2013-03-07 21:54
(Received via mailing list)
I would suggest "creating" as it were your own examples using irb.

I'd start by encoding a string, then decoding that result, eg.

001> x = strict_encode64('hello')
002> strict_decode64(x)
etc.

Sent from my phone, so excuse the typos.
Posted by Matt Mongeau (halogenandtoast)
on 2013-03-07 21:54
(Received via mailing list)
ri strict_decode64
then go read RFC 4648

rinse, repeat.
Posted by unknown (Guest)
on 2013-03-07 22:28
(Received via mailing list)
Am 07.03.2013 21:45, schrieb Pritam Dey:
>  From the doc also I didn't get any examples. So examples with
> explanation might be helpful for me to understand.

Try `ri Base64', there are examples.

And if you do not have any clue for what purpose you would use
those methods then you probably can just ignore them.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.