$ docker run --rm --name validator-libsodium-usage-ruby-rbnacl-random-bytes-batch12-2732 -t --mount type=bind,src=/tmp/validator-status-libsodium-usage-ruby-rbnacl-random-bytes-batch12,dst=/validator/status validator-libsodium-shared bash -lc 'set -euo pipefail /validator/tests/_shared/install_override_debs.sh exec /validator/tests/_shared/run_library_tests.sh "$@"' validator-testcase libsodium usage-ruby-rbnacl-random-bytes-batch12 -- bash -c 'PS4=$1; shift; set -x; source "$@"' validator-xtrace '__VALIDATOR_XTRACE__ ' /validator/tests/libsodium/tests/cases/usage/usage-ruby-rbnacl-random-bytes-batch12.sh no override packages found; continuing with apt originals [0, 1, 32, 1024].each do |n| buf = RbNaCl::Random.random_bytes(n) raise "wrong type for n=#{n}: #{buf.class}" unless buf.is_a?(String) raise "wrong encoding for n=#{n}: #{buf.encoding}" unless buf.encoding == Encoding::BINARY raise "wrong length for n=#{n}: #{buf.bytesize}" unless buf.bytesize == n end s1 = RbNaCl::Random.random_bytes(32) s2 = RbNaCl::Random.random_bytes(32) raise "two 32-byte draws collided" if s1 == s2 puts "ok #{s1.unpack1("H*")[0,8]} #{s2.unpack1("H*")[0,8]}" ' ok 0f7c7efd ad16f82a