Skip to content

Commit 0a4c9d3

Browse files
tniessenxtx1130
authored andcommitted
src: simplify GetExponentString
PR-URL: nodejs#42121 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent cb8c81c commit 0a4c9d3

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/crypto/crypto_common.cc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -518,13 +518,7 @@ MaybeLocal<Value> GetExponentString(
518518
const BIOPointer& bio,
519519
const BIGNUM* e) {
520520
uint64_t exponent_word = static_cast<uint64_t>(BN_get_word(e));
521-
uint32_t lo = static_cast<uint32_t>(exponent_word);
522-
uint32_t hi = static_cast<uint32_t>(exponent_word >> 32);
523-
if (hi == 0)
524-
BIO_printf(bio.get(), "0x%x", lo);
525-
else
526-
BIO_printf(bio.get(), "0x%x%08x", hi, lo);
527-
521+
BIO_printf(bio.get(), "0x%" PRIx64, exponent_word);
528522
return ToV8Value(env, bio);
529523
}
530524

0 commit comments

Comments
 (0)