るりまサーチ

最速Rubyリファレンスマニュアル検索!
524件ヒット [201-300件を表示] (0.126秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:openssl[x] > クエリ:p[x] > クラス:OpenSSL::BN[x]

別のキーワード

  1. openssl new
  2. openssl digest
  3. openssl to_der
  4. openssl to_s
  5. openssl hexdigest

ライブラリ

キーワード

検索結果

<< < 1 2 3 4 5 ... > >>

OpenSSL::BN#**(other) -> OpenSSL::BN (14215.0)

自身の other 乗を返します。

...自身の other 乗を返します。

@param other 指数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#mod_exp...

OpenSSL::BN#+(other) -> OpenSSL::BN (14215.0)

自身と other の和を返します。

...自身と other の和を返します。

@param other 足す整数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#mod_add...

OpenSSL::BN#-(other) -> OpenSSL::BN (14215.0)

自身から other を引いた値を返します。

...自身から other を引いた値を返します。

@param other 引く整数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#mod_sub...

OpenSSL::BN#mod_sqr(m) -> OpenSSL::BN (14215.0)

(self ** 2) % m を返します。

...(self ** 2) % m を返します。

@param m mod を取る数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#sqr...

OpenSSL::BN#sqr -> OpenSSL::BN (14215.0)

自身の2乗を計算します。

...自身の2乗を計算します。

@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#mod_sqr...

絞り込み条件を変える

OpenSSL::BN#%(other) -> OpenSSL::BN (14209.0)

自身を other で割り算した余りを返します。

...自身を other で割り算した余りを返します。

@param other 除数
@raise OpenSSL::BNError 計算時エラー...

OpenSSL::BN#gcd(other) -> OpenSSL::BN (14209.0)

GCD(最大公約数)を返します。

...GCD(最大公約数)を返します。

@param other 自身との GCD を計算する数
@raise OpenSSL::BNError 計算時エラー...

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

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

...0 MPI形式の文字列(バイト列)

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

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

p
10.to_bn.to_s # => "10"
p
(-5).to_bn.to_s # => "-5"

p
0.to_bn.to_s(16) # => "0"
p
9.to_bn....
...to_s(16) # => "09"
p
10.to_bn.to_s(16) # => "0A"
p
16.to_bn.to_s(16) # => "10"
p
26.to_bn.to_s(16) # => "1A"
p
256.to_bn.to_s(16) # => "0100"

p
0.to_bn.to_s(2) # => ""
p
6.to_bn.to_s(2) # => "\x06"
p
7.to_bn.to_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...

OpenSSL::BN#<=>(other) -> -1 | 0 | 1 (14056.0)

自身と other を比較し、自身が小さいときには -1、 等しいときには 0、大きいときには 1 を返します。

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

OpenSSL::BN
.new(5) <=> 5 # => 0

OpenSSL::BN
.new(5) <=> OpenSSL::BN.new(9) # => -1
OpenSSL::BN
.new(5) <=> OpenSSL::BN.new(5) # => 0
OpenSSL::BN
.new(5) <=> OpenSSL::BN.new(-5) # => 1
//}

@param other 比較する整数
@raise TypeError 比較できない...
...ときに発生します。
@see OpenSSL::BN#ucmp...
<< < 1 2 3 4 5 ... > >>