Files
scylladb/utils/ascii.hh
Avi Kivity 0ae22a09d4 LICENSE: Update to version 1.1
Updated terms of non-commercial use (must be a never-customer).
2026-04-12 19:46:33 +03:00

32 lines
535 B
C++

/*
* Optimized ASCII string validation.
*
* Copyright (c) 2018, Arm Limited.
*/
/*
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.1
*/
#pragma once
#include <cstdint>
#include "bytes_fwd.hh"
namespace utils {
namespace ascii {
bool validate(const uint8_t *data, size_t len);
inline bool validate(bytes_view string) {
const uint8_t *data = reinterpret_cast<const uint8_t*>(string.data());
size_t len = string.size();
return validate(data, len);
}
} // namespace ascii
} // namespace utils