- 함수 random_bytes()
1 PHP[ | ]
PHP
Copy
function random_bytes($length) {
if ($length < 1) return false;
$secure = true;
$result = openssl_random_pseudo_bytes($length, $secure);
if ($result == false || !$secure) return false;
if (strlen($result) != $length) return false;
return $result;
}
var_dump( random_bytes(10) );
var_dump( random_bytes(40) );
# string(10) "°±|U쪖¯"
# string(40) "^ÿ°¿8ޜ]
# ²笺Āt헏V%t
2 같이 보기[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.
PHP 파일 다운로드 구현 2 (한글 파일명 지원) ― …PHP에서 오라클 DB 사용 ― YoWuPHP 파일 업로드 구현 ― 일리단사오육칠PHP 파일 업로드 구현 ― JmnotePHP 파일 다운로드 구현 2 (한글 파일명 지원) ― AnmkstLib my.php ― 신정섭Lib my.php ― Jmnote로또번호 생성 ―Pinkcrimson