mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
LibCrypto: Change UnsignedBigInteger parser to use a StringView
SignedBigInteger already accepts a StringView; let's avoid the heap allocation in UnsignedBigInteger.
This commit is contained in:
parent
6b5f6d6c0e
commit
0013227377
2 changed files with 2 additions and 2 deletions
|
@ -67,7 +67,7 @@ size_t UnsignedBigInteger::export_data(Bytes data, bool remove_leading_zeros) co
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
UnsignedBigInteger UnsignedBigInteger::from_base(u16 N, const String& str)
|
UnsignedBigInteger UnsignedBigInteger::from_base(u16 N, StringView str)
|
||||||
{
|
{
|
||||||
VERIFY(N <= 36);
|
VERIFY(N <= 36);
|
||||||
UnsignedBigInteger result;
|
UnsignedBigInteger result;
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
|
|
||||||
size_t export_data(Bytes, bool remove_leading_zeros = false) const;
|
size_t export_data(Bytes, bool remove_leading_zeros = false) const;
|
||||||
|
|
||||||
static UnsignedBigInteger from_base(u16 N, const String& str);
|
static UnsignedBigInteger from_base(u16 N, StringView str);
|
||||||
String to_base(u16 N) const;
|
String to_base(u16 N) const;
|
||||||
|
|
||||||
u64 to_u64() const;
|
u64 to_u64() const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue