mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-07 14:31:20 +00:00
14 lines
244 B
JavaScript
14 lines
244 B
JavaScript
|
'use strict'
|
||
|
|
||
|
const crypto = require('libp2p-crypto')
|
||
|
const constants = require('./constants')
|
||
|
|
||
|
exports = module.exports
|
||
|
|
||
|
exports.rnd = (length) => {
|
||
|
if (!length) {
|
||
|
length = constants.PING_LENGTH
|
||
|
}
|
||
|
return crypto.randomBytes(length)
|
||
|
}
|