Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ActiveState/code
/ recipe-121965.py
File
recipe-121965.py
recipes/Python/121965_base64_encoding__oneliner/recipe-121965.py:None–None ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1
#generate Base64 Alphabet in one line
2
b64list = reduce(
lambda
v,a:v+[chr(ord(a[0])+i)
for
i in range(a[1])],[(
'A'
,26),(
'a'
,26),(
'0'
,10)],[])+[
'+'
,
'/'
,
'='
]
3
4
#now convert each 24 bit field into 4 pieces
Callers
nothing calls this directly
Calls
7
range
Function · 0.85
apply
Function · 0.50
encode
Function · 0.50
join
Method · 0.45
extend
Method · 0.45
pop
Method · 0.45
append
Method · 0.45
Tested by
no test coverage detected