code: 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
    }
docs: Get b58 string from multiaddr or peerinfo
  
  @param {Multiaddr|PeerInfo} peer
  @return {*}