Skip to content
This repository was archived by the owner on May 20, 2022. It is now read-only.

Commit 99bfb9a

Browse files
committed
feat: base64 encode and decode
1 parent dc9682b commit 99bfb9a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

demo-basis/builtin.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# coding:utf-8
22

33
import argparse
4+
import base64
45
import os
56
from collections import ChainMap
67
from collections import Counter
@@ -63,3 +64,10 @@
6364
for ch in 'programming':
6465
c[ch] = c[ch] + 1
6566
print(c)
67+
68+
# ==================================================BASE64编码=================================================
69+
70+
b = base64.encodebytes(b'yoo, cool')
71+
print(b)
72+
print(base64.decodebytes(b))
73+
print(base64.urlsafe_b64encode(b'/user?name=guest'))

0 commit comments

Comments
 (0)