public static byte[] randomPeerId() {

        byte[] peerIdBytes = new BigInteger(512, Utils.getRandom()).toByteArray();

        final String peerId;
        if (peerIdBytes.length > 64)
            peerId = Hex.toHexString(peerIdBytes, 1, 64);
        else
            peerId = Hex.toHexString(peerIdBytes);

        return Hex.decode(peerId);
    }
public static byte [ ] randomPeerId ( ) { byte [ ] peerIdBytes = new BigInteger ( 512 , Utils . getRandom ( ) ) . toByteArray ( ) ; final String peerId ; if ( peerIdBytes . length > 64 ) peerId = Hex . toHexString ( peerIdBytes , 1 , 64 ) ; else peerId = Hex . toHexString ( peerIdBytes ) ; return Hex . decode ( peerId ) ; }
@return generates random peer id for the HelloMessage