Many library functions accept a string or wide string argument with the constraint that the string they receive is properly null-terminated. Passing a character sequence or wide character sequence that is not null-terminated to such a function can result in accessing memory that is outside the bounds of the object. Do not pass a character sequence or wide character sequence that is not null-terminated to a library function that expects a string or wide string argument.
Выложил, как обещал, в репу https://github.com/tamtakoe/node-addon-test В ридми описание как запускать и что делает P.S. Для тех, кто не в теме, это сравнение алгоритма на JS и C++. Последний работает в 10 раз медленнее