るりまサーチ

最速Rubyリファレンスマニュアル検索!
84件ヒット [1-84件を表示] (0.010秒)
トップページ > クエリ:encode[x] > 種類:モジュール関数[x]

別のキーワード

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

ライブラリ

モジュール

キーワード

検索結果

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.#encode64(bin) -> String (6108.0)

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

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

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


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

# => Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g
# UnVieQ==...

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

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

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

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

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

Digest.#hexencode(string) -> String (6101.0)

引数である文字列 string を、16進数に変換した文字列を生成して返します。

...e 'digest'

p Digest.hexencode("") # => ""
p Digest.hexencode("d") # => "64"
p Digest.hexencode("\1\2") # => "0102"
p Digest.hexencode("\xB0") # => "b0"

p digest = Digest::MD5.digest("ruby") # => "X\xE5=\x13$\xEE\xF6&_\xDB\x97\xB0\x8E\xD9\xAA\xDF"
p Digest.hexencode(digest) #...
...08ed9aadf"

p digest = Digest::SHA1.digest("ruby") # => "\x18\xE4\x0E\x14\x01\xEE\xF6~\x1A\xE6\x9E\xFA\xB0\x9A\xFBq\xF8\x7F\xFB\x81"
p Digest.hexencode(digest) # => "18e40e1401eef67e1ae69efab09afb71f87ffb81"
p Digest::SHA1.hexdigest("ruby") # => "18e40e1401eef67e1ae69efab09af...

ERB::Util.#url_encode(s) -> String (3108.0)

文字列 s を URLエンコードした文字列を返します。

...を返します(CGI.escapeとほぼ同じです)。

@param s URLエンコードを行う文字列

//emlist[例][ruby]{
require "erb"
include ERB::Util

puts url_encode("Programming Ruby: The Pragmatic Programmer's Guide")
# Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide
//}...

絞り込み条件を変える

ERB::Util.#u(s) -> String (8.0)

文字列 s を URLエンコードした文字列を返します。

...を返します(CGI.escapeとほぼ同じです)。

@param s URLエンコードを行う文字列

//emlist[例][ruby]{
require "erb"
include ERB::Util

puts url_encode("Programming Ruby: The Pragmatic Programmer's Guide")
# Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide
//}...

Kconv.#tolocale(str) -> String (7.0)

文字列 str のエンコーディングをロケールエンコーディングに変換して返します。

...ドされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換したくない場合は、 String#encode
を使ってください。

Kconv.kconv(str, Encoding.locale_charmap)と同じです。

@param str 変換元の文字列
@see String#tolocale...