mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-24 04:25:10 -07:00
io.js has become node.js
This commit is contained in:
parent
45df38c8c7
commit
52fe697e7a
@ -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
|
||||
|
||||
|
@ -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';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user