るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.085秒)

別のキーワード

  1. string encode
  2. _builtin encode
  3. base64 encode64
  4. string encode!
  5. _builtin encode!

ライブラリ

モジュール

キーワード

検索結果

Base64.#encode64(bin) -> String (18108.0)

与えられたデータを Base64 エンコードした文字列を返します。

...字ごとに改行を追加します。

@param bin Base64 エンコードするデータを指定します。


require 'base64'
Base64.encode64("Now is the time for all good coders\nto learn Ruby")

# => Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g
# UnVieQ==...

Base64.#urlsafe_encode64(bin, padding: true) -> String (6114.0)

与えられたデータを Base64 エンコードした文字列を返します。

...データを指定します。
@param padding false を指定した場合、 = によるパディングが行われなくなります。

//emlist[例][ruby]{
require 'base64'

p Base64.urlsafe_encode64('hoge')
# => "aG9nZQ=="

p Base64.urlsafe_encode64('hoge', padding: false)
# => "aG9nZQ"
//}...

Base64.#strict_encode64(bin) -> String (6102.0)

与えられたデータを Base64 エンコードした文字列を返します。

与えられたデータを Base64 エンコードした文字列を返します。

このメソッドは 4648 に対応しています。
改行コードを追加することはありません。

@param bin Base64 エンコードするデータを指定します。