Strange \n in base64 encoded string in Ruby

后端 未结 6 935
野趣味
野趣味 2020-11-29 00:05

The inbuilt Base64 library in Ruby is adding some \'\\n\'s. I\'m unable to find out the reason. For this special example:

irb(main):001:0> require \'rubyg         


        
6条回答
  •  半阙折子戏
    2020-11-29 00:42

    The \n added when using Base64#encode64 is correct, check this post out: https://glaucocustodio.github.io/2014/09/27/a-reminder-about-base64encode64-in-ruby/

提交回复
热议问题