44件ヒット
[1-44件を表示]
(0.234秒)
種類
- 特異メソッド (33)
- インスタンスメソッド (11)
クラス
-
OpenSSL
:: BN (44)
検索結果
先頭4件
-
OpenSSL
:: BN . new(str , base=10) -> OpenSSL :: BN (21259.0) -
文字列を多倍長整数オブジェクト(OpenSSL::BN)を生成します。
...文字列を多倍長整数オブジェクト(OpenSSL::BN)を生成します。
base で、変換方法(基数)を指定します。
デフォルトは 10 で、他に 16, 2, 0 を指定できます。
10 引数の文字列を 10進数とみなして、変換します。
16 引数の文字......quire 'openssl'
OpenSSL::BN.new("-241") # => -241
OpenSSL::BN.new("ff00",16) # => 65280
OpenSSL::BN.new("\x81",2) # => 129
OpenSSL::BN.new("\xff\x81",2) # => 65409
OpenSSL::BN.new("\x00\x00\x00\x02\x00\x81", 0) # => 129
OpenSSL::BN.new("\x00\x00\x00\x02\x80\x81", 0) # => -129
OpenSSL::BN.new(1209)......を表す文字列
@param base 文字列から整数に変換するときの基数
@raise OpenSSL::BNError 変換に失敗した場合に発生します
反対に、OpenSSL::BN クラスのオブジェクトを文字列にするには、
OpenSSL::BN#to_s を用います。
@see OpenSSL::BN#to_s... -
OpenSSL
:: BN . new(bn) -> OpenSSL :: BN (21214.0) -
OpenSSL::BN を複製して返します。
...
OpenSSL::BN を複製して返します。
@param bn 複製する OpenSSL::BN オブジェクト... -
OpenSSL
:: BN . new(integer) -> OpenSSL :: BN (21214.0) -
整数オブジェクト(Integer)から多倍長整数オブジェクト (OpenSSL::BN)を生成します。
...整数オブジェクト(Integer)から多倍長整数オブジェクト
(OpenSSL::BN)を生成します。
@param integer 整数オブジェクト
@see Integer#to_bn... -
OpenSSL
:: BN # to _ s(base=10) -> String (21199.0) -
自身を表す文字列を返します。
... 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......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...