Spaces:
Runtime error
Runtime error
Download resident.py from IAGeneral/vidu: direct link, hf CLI and curl.
- Browser
- Download file 961 Bytes
-
https://huggingface.co/spaces/IAGeneral/vidu/resolve/main/resident.py
- Command line
-
hf download hf://spaces/IAGeneral/vidu/resident.py
-
curl -L -o resident.py https://huggingface.co/spaces/IAGeneral/vidu/resolve/main/resident.py
961 Bytes
| import base64 | |
| class A: | |
| def __init__(self, shift=5): # Shift está fijo en 5 | |
| self.shift = shift | |
| self.chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' | |
| def c(self, data): | |
| """ | |
| Codifica los datos usando Base64 y altera los caracteres. | |
| """ | |
| encoded = base64.b64encode(data.encode()).decode() | |
| return ''.join(self.chars[(self.chars.index(char) + self.shift) % len(self.chars)] | |
| if char in self.chars else char for char in encoded) | |
| def d(self, data): | |
| """ | |
| Decodifica los datos modificados y los convierte nuevamente en Base64. | |
| """ | |
| decoded = ''.join(self.chars[(self.chars.index(char) - self.shift) % len(self.chars)] | |
| if char in self.chars else char for char in data) | |
| return base64.b64decode(decoded).decode() | |
| # Instancia fija con shift=5 | |
| resident = A(shift=5) | |