Home | Mirror | SearchITEYE 博客 | OSChina 博客 | 51CTO 博客

3.3. Python Base64

編碼:b64encode

			
import base64
base64.b64encode('This is an encoded string')
			
			

此示例將顯示:

'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw=='

解碼:

			
import base64
base64.b64decode('VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==')
			
			

此示例將顯示:

This is an encoded string

comments powered by Disqus