735件ヒット
[101-200件を表示]
(0.065秒)
ライブラリ
- ビルトイン (346)
- matrix (24)
- objspace (12)
- openssl (240)
- securerandom (80)
- timeout (21)
-
webrick
/ utils (12)
クラス
- Array (96)
- IO (12)
- Matrix (24)
-
OpenSSL
:: Cipher (24) -
OpenSSL
:: PKey :: DSA (24) -
OpenSSL
:: PKey :: EC (12) -
OpenSSL
:: PKey :: RSA (24) - Random (141)
モジュール
- Enumerable (48)
- Kernel (48)
- ObjectSpace (12)
-
OpenSSL
:: Random (108) - SecureRandom (68)
- Timeout (21)
-
WEBrick
:: Utils (12)
キーワード
- == (12)
- Cipher (12)
- DEFAULT (9)
- RSA (12)
- RandomError (12)
- SecureRandom (12)
- Symbol (1)
- advise (12)
- alphanumeric (8)
- base64 (12)
- build (24)
-
count
_ tdata _ objects (12) - egd (12)
-
egd
_ bytes (12) - generate (48)
- hex (12)
- left (24)
-
load
_ random _ file (12) -
marshal
_ dump (12) -
marshal
_ load (12) -
max
_ by (48) -
pseudo
_ bytes (12) -
public
_ key? (12) - rand (96)
-
random
_ add (12) -
random
_ bytes (24) -
random
_ iv (12) -
random
_ key (12) -
random
_ number (12) -
random
_ string (12) - sample (48)
- seed (12)
- shuffle (24)
- shuffle! (24)
- srand (24)
- status? (12)
- timeout (21)
-
urlsafe
_ base64 (12) -
write
_ random _ file (12)
検索結果
先頭5件
-
Random
# rand -> Float (21118.0) -
一様な擬似乱数を発生させます。
...生成した場合)には終端の値は乱数の範囲から除かれます。
range.end - range.begin が整数を返す場合は range.begin + self.rand((range.end - range.begin) + e)
の値を返します(e は終端を含む場合は1、含まない場合は0です)。
range.end - range.begin......nd(1..Float::INFINITY) などのように範囲に問題があるときに発生します。
@raise ArgumentError 引数の数が0または1では無い時、引数に負の数値を与えた時や (1..0) のような値が存在しない範囲を渡した時などに発生します。
//emlist[例......][ruby]{
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0.1915194503788923
# max に実数も指定出来る
prng.rand(6.5) # => 4.043707011758907
# (rand(6) と同等)
rand(6.5)... -
Random
# rand(max) -> Integer | Float (21118.0) -
一様な擬似乱数を発生させます。
...生成した場合)には終端の値は乱数の範囲から除かれます。
range.end - range.begin が整数を返す場合は range.begin + self.rand((range.end - range.begin) + e)
の値を返します(e は終端を含む場合は1、含まない場合は0です)。
range.end - range.begin......nd(1..Float::INFINITY) などのように範囲に問題があるときに発生します。
@raise ArgumentError 引数の数が0または1では無い時、引数に負の数値を与えた時や (1..0) のような値が存在しない範囲を渡した時などに発生します。
//emlist[例......][ruby]{
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0.1915194503788923
# max に実数も指定出来る
prng.rand(6.5) # => 4.043707011758907
# (rand(6) と同等)
rand(6.5)... -
Random
# rand(range) -> Integer | Float (21118.0) -
一様な擬似乱数を発生させます。
...生成した場合)には終端の値は乱数の範囲から除かれます。
range.end - range.begin が整数を返す場合は range.begin + self.rand((range.end - range.begin) + e)
の値を返します(e は終端を含む場合は1、含まない場合は0です)。
range.end - range.begin......nd(1..Float::INFINITY) などのように範囲に問題があるときに発生します。
@raise ArgumentError 引数の数が0または1では無い時、引数に負の数値を与えた時や (1..0) のような値が存在しない範囲を渡した時などに発生します。
//emlist[例......][ruby]{
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0.1915194503788923
# max に実数も指定出来る
prng.rand(6.5) # => 4.043707011758907
# (rand(6) と同等)
rand(6.5)... -
Random
# ==(other) -> bool (21112.0) -
乱数生成器が等しい状態であるならばtrue を返します。
...乱数生成器が等しい状態であるならばtrue を返します。
@param other 比較対象の乱数生成器
//emlist[例][ruby]{
r1 = Random.new(1)
r2 = Random.new(1)
p r1 == r2 # => true
r2.rand
p r1 == r2 # => false
r1.rand
p r1 == r2 # => true
//}... -
OpenSSL
:: Random (21048.0) -
OpenSSL が利用する擬似乱数生成器関連のモジュールです。
...OpenSSL が利用する擬似乱数生成器関連のモジュールです。
* 4086
=== 暗号と乱数
OpenSSL では、鍵を生成するためなどに乱数を用いています。例えば RSA では
巨大(512bitや1024bitなど)な素数の組を乱数で生成し、そこから公開鍵......す。
* OpenSSL::PKey::RSA.generate
* OpenSSL::PKey::DSA.generate
* OpenSSL::PKey::DH.generate
* OpenSSL::Cipher#random_key
そのような乱数は適切な実装を持つ擬似乱数生成器に適切なシードを渡す
ことによって実現できます。
OpenSSL にはそのよう......、この擬似乱数生成器は OpenSSL の様々なモジュールから利用されています。
上に挙げた鍵生成メソッドの他に、
* OpenSSL::BN.rand
* OpenSSL::BN.rand_range
* OpenSSL::BN.generate_prime
* OpenSSL::Cipher#random_iv
などでも利用されます。
擬... -
OpenSSL
:: Random . # write _ random _ file(filename) -> true (15307.0) -
乱数生成器で生成された 1024 バイトのランダムなバイト列を ファイルに書き込みます。
...存しなければなりません。
部外者がこのファイルを読めることはセキュリティ上の問題を引き起します。
@param filename 書き込むファイルの名前
@raise OpenSSL::Random::RandomError ファイルの書き出しに失敗した場合に発生します... -
OpenSSL
:: Random . # load _ random _ file(filename) -> true (15219.0) -
ファイルを読み込み、その内容をエントロピー源として 乱数生成器に渡します。
...バイト数と同じであると見なします。
OpenSSL::Random.seed(File.read(filename)) と同じです。
@param filename 読み込むファイル名
@raise OpenSSL::Random::RandomError ファイルの読み込みに失敗した場合に発生します
@raise OpenSSL::Random::RandomError... -
OpenSSL
:: Random . # random _ add(str , entropy) -> self (12201.0) -
乱数生成器にエントロピーを追加します。
乱数生成器にエントロピーを追加します。
entropy には str が持っているエントロピーの予測値(の下限)を
バイト単位で渡します。
@param str 予測不可能な内容の文字列
@param entropy str が持っているエントロピーの予測値(バイト単位)の浮動小数点数 -
OpenSSL
:: Random . # random _ bytes(len) -> String (12201.0) -
暗号論的な予測不可能性を持つ乱数生成器によって、 len バイトの ランダムなバイト列を返します。
...暗号論的な予測不可能性を持つ乱数生成器によって、 len バイトの
ランダムなバイト列を返します。
@param len 必要なランダムバイト列の長さ...