Cast c++ size_t to wasi size_t.
| 128 | |
| 129 | /// Cast c++ size_t to wasi size_t. |
| 130 | constexpr WasiCryptoExpect<__wasi_size_t> toWasiSize(size_t Size) noexcept { |
| 131 | ensureOrReturn(Size <= std::numeric_limits<__wasi_size_t>::max(), |
| 132 | __WASI_CRYPTO_ERRNO_ALGORITHM_FAILURE); |
| 133 | return static_cast<__wasi_size_t>(Size); |
| 134 | } |
| 135 | |
| 136 | /// Convert string_view to inner Alg representation. |
| 137 | template <typename T> WasiCryptoExpect<T> tryFrom(std::string_view) noexcept; |