Generate a random payment ID sample codes

#include <iostream>
#include <random>
 
int main()
{
    std::random_device rd;
    std::uniform_int_distribution<long> dist; // long 32 bits
 
    std::cout << "Random Number: " << dist(rd) << std::endl;
}

<?php
$payment_id = bin2hex(random_bytes(32));
echo($payment_id);
?>

private static String generatePaymentId() {
        def r = new Random()
        def result = (0..<64).collect { r.nextInt(16) }
                .collect { Integer.toString(it, 16) }
                .join()
        return result
    }