AWS SDK for C++  0.14.3
AWS SDK for C++
Hash.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #pragma once
17 
18 #include <aws/core/Core_EXPORTS.h>
22 
23 namespace Aws
24 {
25  namespace Utils
26  {
27  namespace Crypto
28  {
33  {
34  public:
35 
36  Hash() {}
37  virtual ~Hash() {}
38 
42  virtual HashResult Calculate(const Aws::String& str) = 0;
43 
47  virtual HashResult Calculate(Aws::IStream& stream) = 0;
48 
49  // when hashing streams, this is the size of our internal buffer we read the stream into
50  static const uint32_t INTERNAL_HASH_STREAM_BUFFER_SIZE = 8192;
51  };
52 
58  {
59  public:
60  virtual ~HashFactory() {}
61 
65  virtual std::shared_ptr<Hash> CreateImplementation() const = 0;
66 
71  virtual void InitStaticState() {}
72 
77  virtual void CleanupStaticState() {}
78  };
79 
80  } // namespace Crypto
81  } // namespace Utils
82 } // namespace Aws
83 
virtual ~Hash()
Definition: Hash.h:37
virtual void InitStaticState()
Definition: Hash.h:71
std::basic_istream< char, std::char_traits< char > > IStream
Definition: AWSStreamFwd.h:30
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
virtual void CleanupStaticState()
Definition: Hash.h:77
#define AWS_CORE_API
Definition: Core_EXPORTS.h:35
JSON (JavaScript Object Notation).