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
427
absl::optional<uint64_t> StreamIdProviderImpl::toInteger() const {
9
427
  if (id_.length() < 8) {
10
    return absl::nullopt;
11
  }
12

            
13
427
  uint64_t value;
14
427
  if (!StringUtil::atoull(id_.substr(0, 8).c_str(), value, 16)) {
15
    return absl::nullopt;
16
  }
17

            
18
427
  return value;
19
427
}
20

            
21
} // namespace StreamInfo
22
} // namespace Envoy