js-libp2p/src/ping/util.js
Vasco Santos 8506414ea1
chore: config types and dependencies update (#904)
BREAKING CHANGES:

top level types were updated, multiaddr@9.0.0 is used, dialer and keychain internal property names changed and connectionManager minPeers is not supported anymore
2021-04-15 09:40:02 +02:00

19 lines
276 B
JavaScript

'use strict'
const crypto = require('libp2p-crypto')
const constants = require('./constants')
/**
* @param {number} length
*/
function rnd (length) {
if (!length) {
length = constants.PING_LENGTH
}
return crypto.randomBytes(length)
}
module.exports = {
rnd
}