| 79 | // -- utility functions -------------------------------------------------------- |
| 80 | |
| 81 | bool is_ascii(caf::span<const std::byte> buffer) { |
| 82 | auto pred = [](auto x) { return isascii(static_cast<unsigned char>(x)); }; |
| 83 | return std::all_of(buffer.begin(), buffer.end(), pred); |
| 84 | } |
| 85 | |
| 86 | std::string to_ascii(caf::span<const std::byte> buffer) { |
| 87 | return std::string{reinterpret_cast<const char*>(buffer.data()), |