Skip to content

Commit

Permalink
src: simplify GetExponentString
Browse files Browse the repository at this point in the history
PR-URL: nodejs#42121
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
  • Loading branch information
tniessen authored and xtx1130 committed Apr 25, 2022
1 parent cb8c81c commit 0a4c9d3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/crypto/crypto_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,7 @@ MaybeLocal<Value> GetExponentString(
const BIOPointer& bio,
const BIGNUM* e) {
uint64_t exponent_word = static_cast<uint64_t>(BN_get_word(e));
uint32_t lo = static_cast<uint32_t>(exponent_word);
uint32_t hi = static_cast<uint32_t>(exponent_word >> 32);
if (hi == 0)
BIO_printf(bio.get(), "0x%x", lo);
else
BIO_printf(bio.get(), "0x%x%08x", hi, lo);

BIO_printf(bio.get(), "0x%" PRIx64, exponent_word);
return ToV8Value(env, bio);
}

Expand Down

0 comments on commit 0a4c9d3

Please sign in to comment.