mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-11 08:50:37 +00:00
LibCrypto: Convert StringBuilder::appendf() => AK::Format
This commit is contained in:
parent
c2a8869c1f
commit
e76956f712
Notes:
sideshowbarker
2024-07-18 18:35:42 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e76956f7123
2 changed files with 9 additions and 13 deletions
|
@ -26,8 +26,8 @@ constexpr void swap_keys(u32* keys, size_t i, size_t j)
|
|||
String AESCipherBlock::to_string() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
for (size_t i = 0; i < BlockSizeInBits / 8; ++i)
|
||||
builder.appendf("%02x", m_data[i]);
|
||||
for (auto value : m_data)
|
||||
builder.appendff("{:02x}", value);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ String AESCipherKey::to_string() const
|
|||
{
|
||||
StringBuilder builder;
|
||||
for (size_t i = 0; i < (rounds() + 1) * 4; ++i)
|
||||
builder.appendf("%02x", m_rd_keys[i]);
|
||||
builder.appendff("{:02x}", m_rd_keys[i]);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -100,11 +100,9 @@ public:
|
|||
|
||||
virtual String class_name() const override
|
||||
{
|
||||
StringBuilder builder;
|
||||
builder.append("SHA");
|
||||
builder.appendf("%zu", this->DigestSize * 8);
|
||||
return builder.build();
|
||||
};
|
||||
return String::formatted("SHA{}", DigestSize * 8);
|
||||
}
|
||||
|
||||
inline virtual void reset() override
|
||||
{
|
||||
m_data_length = 0;
|
||||
|
@ -152,11 +150,9 @@ public:
|
|||
|
||||
virtual String class_name() const override
|
||||
{
|
||||
StringBuilder builder;
|
||||
builder.append("SHA");
|
||||
builder.appendf("%zu", this->DigestSize * 8);
|
||||
return builder.build();
|
||||
};
|
||||
return String::formatted("SHA{%zu}", DigestSize * 8);
|
||||
}
|
||||
|
||||
inline virtual void reset() override
|
||||
{
|
||||
m_data_length = 0;
|
||||
|
|
Loading…
Reference in a new issue