aboutsummaryrefslogtreecommitdiffhomepage
path: root/misc/random_printable_bytes.php
blob: d2b8770e0beed540ef6f9dc2ddb261efc1fc3b5c (plain)
1
2
3
4
5
6
7
8
9
10
<?php

/**
 * Generates a cryptographically secure random printable string
 * @return string 
 */
function random_printable_bytes(): string {
    // i think 128 bytes should be enough .. i hope so anyway
    return base64_encode(random_bytes(128));
}