#pragma once

#include <string>
#include <string_view>

namespace ta::application::config::identity
{
    [[nodiscard]] inline bool is_valid_identifier(const std::string_view value) noexcept
    {
        if (value.empty())
            return false;

        for (const unsigned char character : value)
        {
            const bool lower = character >= 'a' && character <= 'z';
            const bool digit = character >= '0' && character <= '9';
            if (lower || digit || character == '_' || character == '-' || character == '.')
                continue;
            return false;
        }
        return true;
    }
}
