felixstraube
Active Member
- Joined
- Nov 27, 2023
- Messages
- 492
- Office Version
- 365
- Platform
- Windows
- Web
Based on Theory of this page:
Sunshine2k's homepage - Understanding and implementing Base64
BASE64ENCODE function encodes string with Base64 encoding.
Sunshine2k's homepage - Understanding and implementing Base64
BASE64ENCODE function encodes string with Base64 encoding.
Excel Formula:
=LAMBDA(x,
LET( inputStr, x,
chars, MID(inputStr, SEQUENCE(,LEN(inputStr)),1), t, CONCAT(DEC2BIN(CODE(chars),8)),
base64codes, {"A";"B";"C";"D";"E";"F";"G";"H";"I";"J";"K";"L";"M";"N";"O";"P";"Q";"R";"S";"T";"U";"V";"W";"X";"Y";"Z";"a";"b";"c";"d";"e";"f";"g";"h";"i";"j";"k";"l";"m";"n";"o";"p";"q";"r";"s";"t";"u";"v";"w";"x";"y";"z";"0";"1";"2";"3";"4";"5";"6";"7";"8";"9";"+";"/"},
b, MID(t, SEQUENCE(,LEN(t)),1),
r, WRAPROWS(b, 6,0),
base64chars, BYROW(r, LAMBDA(x, CONCAT(x))),
CONCAT(INDEX(base64codes, BIN2DEC(base64chars)+1))
)
)
Base64EncodeDecode.xlsx | ||||
---|---|---|---|---|
A | B | |||
1 | Input String | LAMBDA Encode | ||
2 | Sun | U3Vu | ||
3 | Office Communications Server 2007 | T2ZmaWNlIENvbW11bmljYXRpb25zIFNlcnZlciAyMDA3 | ||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B2:B3 | B2 | =BASE64ENCODE(A2) |
Lambda Functions | ||
---|---|---|
Name | Formula | |
BASE64ENCODE | =LAMBDA(x, LET( inputStr, x, chars, MID(inputStr, SEQUENCE(,LEN(inputStr)),1), t, CONCAT(DEC2BIN(CODE(chars),8)), base64codes, {"A";"B";"C";"D";"E";"F";"G";"H";"I";"J";"K";"L";"M";"N";"O";"P";"Q";"R";"S";"T";"U";"V";"W";"X";"Y";"Z";"a";"b";"c";"d";"e";"f";"g";"h";"i";"j";"k";"l";"m";"n";"o";"p";"q";"r";"s";"t";"u";"v";"w";"x";"y";"z";"0";"1";"2";"3";"4";"5";"6";"7";"8";"9";"+";"/"}, b, MID(t, SEQUENCE(,LEN(t)),1), r, WRAPROWS(b, 6,0), base64chars, BYROW(r, LAMBDA(x, CONCAT(x))), CONCAT(INDEX(base64codes, BIN2DEC(base64chars)+1)) )) |
Last edited by a moderator:
Upvote
0