mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:28:12 +00:00
LibCrypto: Replace from_base{2,8,10,16}() & to_base10 with from_base(N)
This allows us to support parsing and serializing BigIntegers to and from any base N (such that 2 <= N <= 36).
This commit is contained in:
parent
a768131720
commit
005d75656e
14 changed files with 56 additions and 132 deletions
|
@ -250,7 +250,7 @@ void NullLiteral::generate_bytecode(Bytecode::Generator& generator) const
|
|||
|
||||
void BigIntLiteral::generate_bytecode(Bytecode::Generator& generator) const
|
||||
{
|
||||
generator.emit<Bytecode::Op::NewBigInt>(Crypto::SignedBigInteger::from_base10(m_value.substring(0, m_value.length() - 1)));
|
||||
generator.emit<Bytecode::Op::NewBigInt>(Crypto::SignedBigInteger::from_base(10, m_value.substring(0, m_value.length() - 1)));
|
||||
}
|
||||
|
||||
void StringLiteral::generate_bytecode(Bytecode::Generator& generator) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue