0

I have a string, that can be received by calling

md5 = Digest::MD5.new
md5.update 'abc'
str = md5.to_s
# str == '900150983cd24fb0d6963f7d28e17f72'

I actually don't do so, I only receive this string as an input.

Now I want to receive a result similar to calling

md5.base64digest
# kAFQmDzST7DWlj99KOF/cg==

Summing up: I want to get base64digest of md5 having only digest.to_s as in input. Is it even possible?

Ngoral
  • 4,215
  • 2
  • 20
  • 37
  • 1
    I'm not quite sure what exactly you're asking, but you may want to know how to convert a hex encoded string to a base64 encoded string. If so, see [here](https://stackoverflow.com/a/9987466/9014097). – Topaco Feb 24 '21 at 12:23
  • @Topaco Wow, that's exactly it! You got it right, thank you! – Ngoral Feb 24 '21 at 13:16

0 Answers0