mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibCrypto: Change [XXX]BigInteger::export_data() to use Span.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 04:32:35 +09:00
Author: https://github.com/asynts Commit: https://github.com/SerenityOS/serenity/commit/4709b700bd9 Pull-request: https://github.com/SerenityOS/serenity/pull/2903
@@ -26,6 +26,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Span.h>
|
||||
#include <LibCrypto/BigInt/UnsignedBigInteger.h>
|
||||
|
||||
namespace Crypto {
|
||||
@@ -66,13 +67,7 @@ public:
|
||||
static SignedBigInteger import_data(const AK::StringView& data) { return import_data((const u8*)data.characters_without_null_termination(), data.length()); }
|
||||
static SignedBigInteger import_data(const u8* ptr, size_t length);
|
||||
|
||||
size_t export_data(AK::ByteBuffer& data) const;
|
||||
size_t export_data(u8* ptr, size_t length) const
|
||||
{
|
||||
// Note: ByteBuffer::wrap() does a const_cast!
|
||||
auto buffer = ByteBuffer::wrap(ptr, length);
|
||||
return export_data(buffer);
|
||||
}
|
||||
size_t export_data(Bytes) const;
|
||||
|
||||
static SignedBigInteger from_base10(StringView str);
|
||||
String to_base10() const;
|
||||
|
||||
Reference in New Issue
Block a user