| 91 | static bool scHttpWebSocketIsSpace(char value) { return value == ' ' or value == '\t'; } |
| 92 | |
| 93 | static SC::StringSpan scHttpWebSocketTrim(SC::StringSpan value) |
| 94 | { |
| 95 | const char* start = value.bytesWithoutTerminator(); |
| 96 | const char* end = start + value.sizeInBytes(); |
| 97 | while (start < end and scHttpWebSocketIsSpace(*start)) |
| 98 | { |
| 99 | start++; |
| 100 | } |
| 101 | while (end > start and scHttpWebSocketIsSpace(*(end - 1))) |
| 102 | { |
| 103 | end--; |
| 104 | } |
| 105 | return {{start, static_cast<size_t>(end - start)}, false, value.getEncoding()}; |
| 106 | } |
| 107 | |
| 108 | static SC::Result scHttpWebSocketBase64Encode(SC::Span<const uint8_t> data, SC::Span<char> storage, |
| 109 | SC::StringSpan& output) |
no test coverage detected