Method: OpenSSL::BN#to_i
- Defined in:
- ossl_bn.c
#to_i ⇒ Integer Also known as: to_int
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
# File 'ossl_bn.c', line 376
static VALUE
ossl_bn_to_i(VALUE self)
{
BIGNUM *bn;
char *txt;
VALUE num;
GetBN(self, bn);
if (!(txt = BN_bn2hex(bn))) {
ossl_raise(eBNError, NULL);
}
num = rb_cstr_to_inum(txt, 16, Qtrue);
OPENSSL_free(txt);
return num;
}
|