| 59 | { |
| 60 | struct DstHash { |
| 61 | size_t |
| 62 | operator()(const PreWarm::SPtrConstDst &dst) const |
| 63 | { |
| 64 | CryptoHash hash; |
| 65 | CryptoContext context{}; |
| 66 | |
| 67 | context.update(dst->host.data(), dst->host.size()); |
| 68 | context.update(&dst->port, sizeof(in_port_t)); |
| 69 | context.update(&dst->type, sizeof(SNIRoutingType)); |
| 70 | context.update(&dst->alpn_index, sizeof(int)); |
| 71 | |
| 72 | context.finalize(hash); |
| 73 | |
| 74 | return static_cast<size_t>(hash.fold()); |
| 75 | } |
| 76 | }; |
| 77 | |
| 78 | struct DstKeyEqual { |