1 개요
- PHP openssl_random_pseudo_bytes()
PHP
Copy
for( $len=-1; $len<4; $len++) {
$bytes = openssl_random_pseudo_bytes($len, $cstrong);
echo "---- len = $len ----" . PHP_EOL;
var_dump($cstrong);
var_dump(bin2hex($bytes));
}
# ---- len = -1 ----
# NULL
# string(0) ""
# ---- len = 0 ----
# NULL
# string(0) ""
# ---- len = 1 ----
# bool(true)
# string(2) "a2"
# ---- len = 2 ----
# bool(true)
# string(4) "0edc"
# ---- len = 3 ----
# bool(true)
# string(6) "83fb29"
2 같이 보기
3 참고 자료
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.
PHP 파일 다운로드 구현 2 (한글 파일명 지원) ― …PHP에서 오라클 DB 사용 ― YoWuPHP 파일 업로드 구현 ― 일리단사오육칠PHP 파일 업로드 구현 ― JmnotePHP 파일 다운로드 구현 2 (한글 파일명 지원) ― AnmkstLib my.php ― 신정섭Lib my.php ― Jmnote로또번호 생성 ―Pinkcrimson