From 3a63633be3190930d4245d5eac25e54ebb39350e Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Thu, 4 Jul 2024 22:29:24 +0200 Subject: [PATCH] Common/Crypto/SHA1: Use span and string_view for Context::Update() --- Source/Core/Common/Crypto/SHA1.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Core/Common/Crypto/SHA1.h b/Source/Core/Common/Crypto/SHA1.h index b828c28f15..6fd29172c0 100644 --- a/Source/Core/Common/Crypto/SHA1.h +++ b/Source/Core/Common/Crypto/SHA1.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -23,7 +24,11 @@ class Context public: virtual ~Context() = default; virtual void Update(const u8* msg, size_t len) = 0; - void Update(const std::vector& msg) { return Update(msg.data(), msg.size()); } + void Update(std::span msg) { return Update(msg.data(), msg.size()); } + void Update(std::string_view msg) + { + return Update(reinterpret_cast(msg.data()), msg.size()); + } virtual Digest Finish() = 0; virtual bool HwAccelerated() const = 0; };