るりまサーチ (Ruby 2.1.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.147秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:l[x] > バージョン:2.1.0[x] > クエリ:tr[x] > クラス:OpenSSL::BN[x]

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l
  5. l

ライブラリ

キーワード

検索結果

OpenSSL::BN#prime_fasttest?(checks=nil, vtrivdiv=true) -> bool (9907.0)

自身が素数であるなら true を返します。

...ある
OpenSSL::BN
.new("181").prime_fasttest?(nil, true) # => false
OpenSSL::BN
.new("181").prime_fasttest?(nil, false) # => true
//}

@param checks Miller-Robin法の繰り返しの回数
@param vtrivdiv 真なら小さな素数で割ることでの素数判定を試みます
@raise OpenSSL::BNError...
...判定時にエラーが発生
@see OpenSSL::BN#prime?...

OpenSSL::BN#to_s(base=10) -> String (9307.0)

自身を表す文字列を返します。

...-endianの符号無し整数のバイナリ列
0 MPI形式の文字列(バイト列)

@param base 文字列への変換方法(基数)
@raise OpenSSL::BNError 変換に失敗した場合に発生します

//emlist[][ruby]{
require 'openssl'

p 10.to_bn.to_s # => "10"
p (-5).to_bn.to_s # => "...
...o_s(2) # => "\a"

p 0.to_bn.to_s(0) # => "\x00\x00\x00\x00"
p 6.to_bn.to_s(0) # => "\x00\x00\x00\x01\x06"
p 7.to_bn.to_s(0) # => "\x00\x00\x00\x01\a"
//}

反対に、文字列から OpenSSL::BN クラスのインスタンスを作るには
OpenSSL::BN
.new を用います。

@see OpenSSL::BN.new...