Security\Random::base64Safe

public base64Safe ([mixed $len], [mixed $padding])

Generates a random URL-safe base64 string If $len is not specified, 16 is assumed. It may be larger in future. The length of the result string is usually greater of $len. By default, padding is not generated because “=” may be used as a URL delimiter. The result may contain A-Z, a-z, 0-9, “-” and “_”. “=” is also used if $padding is true. See RFC 3548 for the definition of URL-safe base64.

1
2
3
$random = new \Phalcon\Security\Random();
 
  echo $random->base64Safe(); // GD8JojhzSTrqX7Q8J6uug
doc_Phalcon
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.