9件ヒット
[1-9件を表示]
(0.049秒)
ライブラリ
- securerandom (7)
モジュール
- SecureRandom (6)
キーワード
-
NEWS for Ruby 2
. 5 . 0 (1) -
NEWS for Ruby 3
. 0 . 0 (1) - alphanumeric (1)
- base64 (1)
- hex (1)
-
random
_ bytes (1) -
urlsafe
_ base64 (1) - uuid (1)
検索結果
先頭5件
-
SecureRandom (114343.0)
-
安全な乱数発生器のためのインターフェースを提供するモジュールです。 HTTP のセッションキーなどに適しています。
安全な乱数発生器のためのインターフェースを提供するモジュールです。
HTTP のセッションキーなどに適しています。
以下の乱数発生器をサポートしています。
* openssl
* /dev/urandom
上の安全な乱数発生器が使用できない場合、各メソッドは NotImplementedError を発生します。
# random hexadecimal string.
require 'securerandom'
p SecureRandom.hex(10) #=> "52750b30ffbc7de3b362"
p SecureRandom.hex(10) #... -
SecureRandom
. urlsafe _ base64(n = nil , padding = false) -> String (63412.0) -
ランダムで URL-safe な base64 文字列を生成して返します。
ランダムで URL-safe な base64 文字列を生成して返します。
@param n 文字列の生成に使われるランダムネスのサイズを整数で指定します。
生成される文字列のサイズはn の約 4/3 倍になります。
nil を指定した場合 n として 16 が使われます。
@param padding 真を指定すると '=' でパディングを行います。
偽を指定するとパディングを行いません。デフォルトは偽です。
@raise NotImplementedError 安全な乱数発生器が使えない場合に発生します。
... -
SecureRandom
. alphanumeric(n = nil) -> String (63358.0) -
ランダムな英数字を生成して返します。
ランダムな英数字を生成して返します。
@param n 生成される文字列のサイズを整数で指定します。
nil を指定した場合 n として 16 が使われます。
@return A-Z, a-z, 0-9 からなる文字列が返されます。
@raise NotImplementedError 安全な乱数発生器が使えない場合に発生します。
//emlist[][ruby]{
require 'securerandom'
p SecureRandom.alphanumeric #=> "2BuBuLf3WfSKyQbR"
p SecureRandom.alphanumeric(... -
SecureRandom
. uuid -> String (63358.0) -
バージョン 4 の UUID (Universally Unique IDentifier) を生成して返します。
バージョン 4 の UUID (Universally Unique IDentifier) を生成して返します。
version 4 の UUID は全くランダムです (バージョンを除いて)。
この UUID は MAC アドレスや時刻などのような意味のある情報を含みません。
@raise NotImplementedError 安全な乱数発生器が使えない場合に発生します。
require 'securerandom'
p SecureRandom.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594"
p SecureRan... -
SecureRandom
. base64(n = nil) -> String (63340.0) -
ランダムな base64 文字列を生成して返します。
ランダムな base64 文字列を生成して返します。
@param n 文字列の生成に使われるランダムネスのサイズを整数で指定します。
生成される文字列のサイズではないことに注意して下さい。生成される文字列のサイズは
n の約 4/3 倍になります。nil を指定した場合 n として 16 が使われます。
@raise NotImplementedError 安全な乱数発生器が使えない場合に発生します。
require 'securerandom'
p SecureRandom.base64(3) #=> "4pYO" (文字列のサイ... -
SecureRandom
. hex(n = nil) -> String (63340.0) -
ランダムな hex 文字列を生成して返します。
ランダムな hex 文字列を生成して返します。
@param n 文字列の生成に使われるランダムネスのサイズを整数で指定します。
生成される文字列のサイズではないことに注意して下さい。生成される文字列のサイズは
n の 2 倍になります。nil を指定した場合 n として 16 が使われます。
@raise NotImplementedError 安全な乱数発生器が使えない場合に発生します。
require 'securerandom'
p SecureRandom.hex(3) #=> "f72233" (文字列のサイズは 3 で... -
SecureRandom
. random _ bytes(n = nil) -> String (63340.0) -
ランダムなバイト列を生成して返します。
ランダムなバイト列を生成して返します。
@param n 生成される文字列のサイズを整数で指定します。
nil を指定した場合 n として 16 が使われます。
@raise NotImplementedError 安全な乱数発生器が使えない場合に発生します。
require 'securerandom'
p SecureRandom.random_bytes(3) #=> "\321\020\203" -
NEWS for Ruby 3
. 0 . 0 (793.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...NEWS for Ruby 3.0.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス......eywords.
16166
//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}
pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]
pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}
* Arguments forwarding (`...`) now supports leading arguments.
16378
//eml......7260
* `in` is changed to return `true` or `false`. 17371
//emlist{
0 => a
p a #=> 0
{b: 0, c: 1} => {b:}
p b #=> 0
//}
//emlist{
# version 3.0
0 in 1 #=> false
# version 2.7
0 in 1 #=> raise NoMatchingPatternError
//}
* Find-pattern is added. [EXPERIMENTAL]
16828
//emlist{
case [... -
NEWS for Ruby 2
. 5 . 0 (361.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...はext/openssl/History.mdの"Version 2.1.0"セクションにあります。
* pathname
* Pathname#glob を追加 7360
* psych
* Psych 3.0.2 に更新しました
* Convert fallback option to a keyword argument
https://github.com/ruby/psych/pull/342
* Add :symbolize...