Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/istio/utils/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ cc_library(
name = "headers_lib",
hdrs = [
"attributes_builder.h",
"concat_hash.h",
"local_attributes.h",
"md5.h",
"protobuf.h",
"status.h",
],
Expand Down
65 changes: 65 additions & 0 deletions include/istio/utils/concat_hash.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* Copyright 2017 Istio Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef ISTIO_UTILS_CONCAT_HASH_H_
#define ISTIO_UTILS_CONCAT_HASH_H_

#include <string.h>
#include <functional>
#include <string>

namespace istio {
namespace utils {

// The hash type for Check cache.
typedef std::size_t HashType;

// This class concatenates multiple values into a string as hash
class ConcatHash {
public:
ConcatHash(size_t reserve_size) { hash_.reserve(reserve_size); }

// Updates the context with data.
ConcatHash& Update(const void* data, size_t size) {
hash_.append(static_cast<const char*>(data), size);
return *this;
}

// A helper function for int
ConcatHash& Update(int d) { return Update(&d, sizeof(d)); }

// A helper function for const char*
ConcatHash& Update(const char* str) {
hash_.append(str);
return *this;
}

// A helper function for const string
ConcatHash& Update(const std::string& str) {
hash_.append(str);
return *this;
}

// Returns the hash of the concated string.
HashType getHash() const { return std::hash<std::string>{}(hash_); }

private:
std::string hash_;
};

} // namespace utils
} // namespace istio

#endif // ISTIO_UTILS_CONCAT_HASH_H_
68 changes: 0 additions & 68 deletions include/istio/utils/md5.h

This file was deleted.

1 change: 0 additions & 1 deletion src/envoy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ envoy_cc_binary(
"//src/envoy/http/jwt_auth:http_filter_factory",
"//src/envoy/http/mixer:filter_lib",
"//src/envoy/tcp/mixer:filter_lib",
"//src/envoy/alts:alts_socket_factory",
"@envoy//source/exe:envoy_main_entry_lib",
],
)
Expand Down
111 changes: 0 additions & 111 deletions src/envoy/alts/BUILD

This file was deleted.

13 changes: 0 additions & 13 deletions src/envoy/alts/README.md

This file was deleted.

31 changes: 0 additions & 31 deletions src/envoy/alts/alts_socket.proto

This file was deleted.

Loading