mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
AK: Rename span() to bytes() when appropriate.
I originally defined the bytes() method for the String class, because it made it obvious that it's a span of bytes instead of span of characters. This commit makes this more consistent by defining a bytes() method when the type of the span is known to be u8. Additionaly, the cast operator to Bytes is overloaded for ByteBuffer and such.
This commit is contained in:
parent
525d51bbb5
commit
fff581cd72
Notes:
sideshowbarker
2024-07-19 03:34:56 +09:00
Author: https://github.com/asynts
Commit: fff581cd72
Pull-request: https://github.com/SerenityOS/serenity/pull/3166
Reviewed-by: https://github.com/nico
18 changed files with 51 additions and 45 deletions
|
@ -69,11 +69,11 @@ public:
|
|||
typename CipherType::CTRMode cipher(m_key, KeySize);
|
||||
|
||||
Bytes buffer_span { buffer, n };
|
||||
auto counter_span = m_counter.span();
|
||||
auto counter_span = m_counter.bytes();
|
||||
cipher.key_stream(buffer_span, counter_span, &counter_span);
|
||||
|
||||
// Extract a new key from the prng stream.
|
||||
Bytes key_span = m_key.span();
|
||||
Bytes key_span = m_key.bytes();
|
||||
cipher.key_stream(key_span, counter_span, &counter_span);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue