Line data Source code
1 : #include "source/common/stream_info/stream_id_provider_impl.h" 2 : 3 : #include "source/common/common/utility.h" 4 : 5 : namespace Envoy { 6 : namespace StreamInfo { 7 : 8 0 : absl::optional<uint64_t> StreamIdProviderImpl::toInteger() const { 9 0 : if (id_.length() < 8) { 10 0 : return absl::nullopt; 11 0 : } 12 : 13 0 : uint64_t value; 14 0 : if (!StringUtil::atoull(id_.substr(0, 8).c_str(), value, 16)) { 15 0 : return absl::nullopt; 16 0 : } 17 : 18 0 : return value; 19 0 : } 20 : 21 : } // namespace StreamInfo 22 : } // namespace Envoy