From: "NARUSE, Yui" Date: 2012-02-23T10:56:40+09:00 Subject: [ruby-core:42822] Re: [ruby-trunk - Feature #6065] Allow Bignum marshalling/unmarshalling from C API 2012/2/23 Martin Bosslet : > Akira Tanaka wrote: >> 2012/2/23 Martin Bosslet : >> >> �> Currently, there's no public C API to create a Bignum. >> �> There is rb_big_pack and rb_big_unpack that will do the >> �> job, but they are not portable. >> >> �How are they not portable? >> �-- >> �Tanaka Akira > > Sorry, "not portable" was probably the wrong wording. I meant > I can't use them e.g. from Rubinius because they're not part > of the public API and they rely on machine endianness. String#to_s is current workaround. ruby -ropenssl -e'p OpenSSL::BN.new((1<<64).to_s(16), 16)' -- NARUSE, Yui �