"함수 urlsafe b64encode()"의 두 판 사이의 차이

3번째 줄: 3번째 줄:
{{DISPLAYTITLE:함수 urlsafe_b64encode()}}
{{DISPLAYTITLE:함수 urlsafe_b64encode()}}
;함수 urlsafe_b64encode()
;함수 urlsafe_b64encode()
==PHP==
[[분류: PHP]]
{{참고|PHP urlsafe_b64encode()}}
<syntaxhighlight lang='python' run>
function urlsafe_b64encode($input)
{
    return str_replace('=', '', strtr(base64_encode($input), '+/', '-_'));
}
echo urlsafe_b64encode('Hello World');
</syntaxhighlight>


==Python==
==Python==

2021년 7월 19일 (월) 10:53 판

1 개요

함수 urlsafe_b64encode()

2 PHP

function urlsafe_b64encode($input)
{
    return str_replace('=', '', strtr(base64_encode($input), '+/', '-_'));
}
echo urlsafe_b64encode('Hello World');

3 Python

from base64 import urlsafe_b64encode

s = b'Hello World'
print( urlsafe_b64encode(s) ) # b'SGVsbG8gV29ybGQ='

4 같이 보기

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