MCPcopy Create free account
hub / github.com/TimMcCool/scratchattach / encode

Method encode

scratchattach/utils/encoder.py:136–151  ·  view source on GitHub ↗

Args: inp (str): The decoded input. Returns: str: The encoded output.

(inp)

Source from the content-addressed store, hash-verified

134
135 @staticmethod
136 def encode(inp):
137 """
138 Args:
139 inp (str): The decoded input.
140
141 Returns:
142 str: The encoded output.
143 """
144 inp = str(inp)
145 outp = ""
146 for i in inp:
147 if i in letters:
148 outp = f"{outp}{letters.index(i)}"
149 else:
150 outp += str(letters.index(" "))
151 return outp
152
153 @staticmethod
154 def replace_char(old_char, new_char):

Callers 5

_parse_outputMethod · 0.80
set_thumbnailMethod · 0.80
login_by_idFunction · 0.80
cmdFunction · 0.80
str_2_keyFunction · 0.80

Calls 1

indexMethod · 0.80

Tested by

no test coverage detected