るりまサーチ (Ruby 2.7.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.128秒)

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. _builtin to_a
  4. openssl to_pem

ライブラリ

検索結果

OpenSSL::BN#to_s(base=10) -> String (87652.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...