From Base64
Category: Encoding
Status: Registered and callable in the CyberChef 11.3.0 compatibility inventory.
Input / output: string → byteArray
Background: https://wikipedia.org/wiki/Base64
What it does
Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be
conveniently used by humans and processed by computers. This operation decodes data from an ASCII
Base64 string back into its raw format. e.g. aGVsbG8= becomes hello
Note
Status here means the operation name is implemented and callable. It does not by itself promise byte-for-byte parity for every upstream option. See Compatibility and current status for the verified scope and known boundaries.
Arguments and options
Arguments are positional. Keep their order when using bake() or
Pipeline.then().
Index |
Name |
UI type |
PyChef default |
Accepted values / format |
|---|---|---|---|---|
|
Alphabet |
|
|
|
|
Remove non-alphabet chars |
|
|
|
|
Strict mode |
|
|
|
Working recipe example
from pychef import bake
input_value = "SGVsbG8="
args = ['A-Za-z0-9+/=', True, False]
result = bake(input_value, [{"op": 'From Base64', "args": args}])
print(result)
Expected representation: b'Hello'.
Pipeline example
from pychef import Pipeline
args = ['A-Za-z0-9+/=', True, False]
transform = Pipeline().then('From Base64', *args)
result = transform("SGVsbG8=")
Direct call
pychef.ops.run_operation runs any registered operation as a plain function,
under the active ExecutionPolicy (safe defaults, no network):
from pychef.ops import run_operation
args = ['A-Za-z0-9+/=', True, False]
result = run_operation('From Base64', "SGVsbG8=", args=args)
Common operations also have typed helpers in Direct operations.
Low-level operation module
Warning
The module below is an internal implementation detail. It applies no execution
policy, resource limits, or error sanitization; prefer bake(), Pipeline,
or pychef.ops for application code.
The registered entry point lives in
pychef.operations.by_operation.from_base64. Direct calls
receive the input value and a positional argument tuple:
from pychef.operations.by_operation.from_base64 import run
result = run("SGVsbG8=", tuple(['A-Za-z0-9+/=', True, False]))
- pychef.operations.by_operation.from_base64.run(value, args)
Run this operation using its shared internal implementation.
- Parameters:
value (str | bytes)
args (Sequence[Any])
- Return type:
str | bytes