LibCrypto+LibJS: Add to_i64 method for SignedBigInteger and use it

This commit is contained in:
Luke Wilde
2026-01-14 13:46:06 +00:00
committed by Tim Flynn
parent 115a794291
commit 8395db7e84
Notes: github-actions[bot] 2026-01-16 12:01:41 +00:00
3 changed files with 7 additions and 2 deletions

View File

@@ -144,6 +144,11 @@ ErrorOr<String> SignedBigInteger::to_base(u16 N) const
return StringView(buffer.bytes().slice(0, written - 1)).to_ascii_lowercase_string();
}
i64 SignedBigInteger::to_i64() const
{
return mp_get_i64(&m_mp);
}
u64 SignedBigInteger::to_u64() const
{
return mp_get_u64(&m_mp);