ChecksumFunction.h 416 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Span.h>
  8. namespace Crypto::Checksum {
  9. template<typename ChecksumT>
  10. class ChecksumFunction {
  11. public:
  12. using ChecksumType = ChecksumT;
  13. virtual void update(ReadonlyBytes data) = 0;
  14. virtual ChecksumType digest() = 0;
  15. protected:
  16. virtual ~ChecksumFunction() = default;
  17. };
  18. }