src/circuit/utils.js
function getB58String (peer) {
    let b58Id = null
    if (multiaddr.isMultiaddr(peer)) {
      const relayMa = multiaddr(peer)
      b58Id = relayMa.getPeerId()
    } else if (PeerInfo.isPeerInfo(peer)) {
      b58Id = peer.id.toB58String()
    }

    return b58Id
  }
function getB58String (peer) {
    let b58Id = null
    if (multiaddr.isMultiaddr(peer)) {
      const relayMa = multiaddr(peer)
      b58Id = relayMa.getPeerId()
    } else if (PeerInfo.isPeerInfo(peer)) {
      b58Id = peer.id.toB58String()
    }

    return b58Id
  }
function getB58String ( peer ) { let b58Id = null if ( multiaddr . isMultiaddr ( peer ) ) { const relayMa = multiaddr ( peer ) b58Id = relayMa . getPeerId ( ) } else if ( PeerInfo . isPeerInfo ( peer ) ) { b58Id = peer . id . toB58String ( ) } return b58Id }
Get b58 string from multiaddr or peerinfo

@param {Multiaddr|PeerInfo} peer
@return {*}
Get b58 string from multiaddr or peerinfo