#include <stddef.h>
#include <limits>
#include <stdexcept>

namespace icure::nitrokryptom::conversions {

int safe_size_to_int(size_t n) {
    if (n <= std::numeric_limits<int>::max()) {
        return static_cast<int>(n);
    } else {
        throw std::runtime_error("Size out of range for openssl lib");
    }
}

}
