- num_bytes -> Integer[permalink][rdoc][edit]
- 
自身を表現するのに使っているバイト数を返します。 require 'openssl' p 0.to_bn.num_bytes # => 0 p 255.to_bn.num_bytes # => 1 p 256.to_bn.num_bytes # => 2 p 0b111_11111.to_bn.num_bytes # => 1 p 0b1000_00000.to_bn.num_bytes # => 2
num_bytes -> Integer[permalink][rdoc][edit]自身を表現するのに使っているバイト数を返します。
require 'openssl'
p 0.to_bn.num_bytes   # => 0
p 255.to_bn.num_bytes # => 1
p 256.to_bn.num_bytes # => 2
p  0b111_11111.to_bn.num_bytes # => 1
p 0b1000_00000.to_bn.num_bytes # => 2