nodejs: simplify design

This commit is contained in:
Adrien Beraud committed 2026-10-27 20:12:17 -04:00
1 parent 05abfa89bf
commit 747e70d1ae
6 files changed
+106 -202

No files matched your search

-2
View File
@@ -51,8 +51,6 @@ bytes(Napi::Value value)
if (!value.IsTypedArray() || value.As<Napi::TypedArray>().TypedArrayType() != napi_uint8_array)
throw Napi::TypeError::New(value.Env(), "Expected a Uint8Array");
auto array = value.As<Napi::Uint8Array>();
if (array.ElementLength() > 16 * 1024 * 1024)
throw Napi::RangeError::New(value.Env(), "Crypto input exceeds 16 MiB");
dht::Blob result(array.ElementLength());
if (!result.empty())
std::copy_n(array.Data(), result.size(), result.data());