"PHP openssl random pseudo bytes()"의 두 판 사이의 차이

(새 문서: ==개요== ;PHP openssl_random_pseudo_bytes() <source lang='php'> for( $len=-1; $len<4; $len++) { $bytes = openssl_random_pseudo_bytes($len, $cstrong); echo "---- len = $len ----"...)
 
잔글 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
 
(사용자 2명의 중간 판 7개는 보이지 않습니다)
2번째 줄: 2번째 줄:
;PHP openssl_random_pseudo_bytes()
;PHP openssl_random_pseudo_bytes()


<source lang='php'>
<syntaxhighlight lang='php' run>
for( $len=-1; $len<4; $len++) {
for( $len=1; $len<4; $len++) {
$bytes = openssl_random_pseudo_bytes($len, $cstrong);
$bytes = openssl_random_pseudo_bytes($len, $cstrong);
echo "---- len = $len ----" . PHP_EOL;
echo "---- len = $len ----" . PHP_EOL;
9번째 줄: 9번째 줄:
var_dump(bin2hex($bytes));
var_dump(bin2hex($bytes));
}
}
# ---- len = -1 ----
</syntaxhighlight>
# 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"
</source>


==같이 보기==
==같이 보기==
31번째 줄: 16번째 줄:
*[[PHP mt_rand()]]
*[[PHP mt_rand()]]
*[[PHP uniqid()]]
*[[PHP uniqid()]]
*[[PHP bin2hex()]]
*[[PHP OpenSSL 함수]]


==참고 자료==
==참고==
* http://php.net/manual/en/function.openssl-random-pseudo-bytes.php
* http://php.net/manual/en/function.openssl-random-pseudo-bytes.php


[[분류: PHP]]
[[분류: PHP]]
[[분류: 랜덤]]
[[분류: 랜덤]]

2020년 11월 2일 (월) 02:35 기준 최신판

1 개요[ | ]

PHP openssl_random_pseudo_bytes()
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));
}

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}