diff --git a/dist-build/emscripten.sh b/dist-build/emscripten.sh index ac46be70..3fd95673 100755 --- a/dist-build/emscripten.sh +++ b/dist-build/emscripten.sh @@ -17,7 +17,7 @@ emcc -O3 --llvm-lto 1 --memory-init-file 0 $LDFLAGS $JS_EXPORTS_FLAGS \ "${PREFIX}/lib/libsodium.a" -o "${PREFIX}/lib/libsodium.js" || exit 1 if test "x$NODE" = x; then - for candidate in iojs node nodejs; do + for candidate in node nodejs; do case $($candidate --version 2>&1) in #( v*) NODE=$candidate @@ -27,7 +27,7 @@ if test "x$NODE" = x; then fi if test "x$NODE" = x; then - echo 'io.js / node.js not found - test suite skipped.' >&2 + echo 'node.js not found - test suite skipped.' >&2 exit 1 fi diff --git a/src/libsodium/randombytes/randombytes.c b/src/libsodium/randombytes/randombytes.c index e9e0e513..00490eb5 100644 --- a/src/libsodium/randombytes/randombytes.c +++ b/src/libsodium/randombytes/randombytes.c @@ -81,12 +81,12 @@ randombytes_stir(void) } catch (e) { try { var crypto = require('crypto'), - randomValueIOJS = function() { + randomValueNodeJS = function() { var buf = crypto.randomBytes(4); return (buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3]) >>> 0; }; - randomValueIOJS(); - Module.getRandomValue = randomValueIOJS; + randomValueNodeJS(); + Module.getRandomValue = randomValueNodeJS; } catch (e) { throw 'No secure random number generator found'; }