diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
commit | cfca06d7963fa0909f90483b42a6d7d194d01e08 (patch) | |
tree | 209fb2a2d68f8f277793fc8df46c753d31bc853b /llvm/lib/Support/SHA1.cpp | |
parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) |
Notes
Diffstat (limited to 'llvm/lib/Support/SHA1.cpp')
-rw-r--r-- | llvm/lib/Support/SHA1.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/Support/SHA1.cpp b/llvm/lib/Support/SHA1.cpp index a98ca41a3354..417b13fea05a 100644 --- a/llvm/lib/Support/SHA1.cpp +++ b/llvm/lib/Support/SHA1.cpp @@ -16,13 +16,13 @@ #include "llvm/Support/SHA1.h" #include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/StringRef.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Host.h" -using namespace llvm; - -#include <stdint.h> #include <string.h> +using namespace llvm; + #if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN #define SHA_BIG_ENDIAN #endif @@ -238,6 +238,11 @@ void SHA1::update(ArrayRef<uint8_t> Data) { addUncounted(C); } +void SHA1::update(StringRef Str) { + update( + ArrayRef<uint8_t>((uint8_t *)const_cast<char *>(Str.data()), Str.size())); +} + void SHA1::pad() { // Implement SHA-1 padding (fips180-2 5.1.1) |