Kekik 1.7.4__tar.gz → 1.7.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of Kekik might be problematic. Click here for more details.

Files changed (49) hide show
  1. kekik-1.7.6/Kekik/Sifreleme/Packer.py +199 -0
  2. {kekik-1.7.4 → kekik-1.7.6}/Kekik.egg-info/PKG-INFO +7 -1
  3. {kekik-1.7.4 → kekik-1.7.6}/Kekik.egg-info/requires.txt +1 -0
  4. {kekik-1.7.4 → kekik-1.7.6}/PKG-INFO +7 -1
  5. {kekik-1.7.4 → kekik-1.7.6}/README.md +5 -0
  6. {kekik-1.7.4 → kekik-1.7.6}/setup.py +3 -2
  7. kekik-1.7.4/Kekik/Sifreleme/Packer.py +0 -62
  8. {kekik-1.7.4 → kekik-1.7.6}/Kekik/BIST.py +0 -0
  9. {kekik-1.7.4 → kekik-1.7.6}/Kekik/Domain2IP.py +0 -0
  10. {kekik-1.7.4 → kekik-1.7.6}/Kekik/Nesne.py +0 -0
  11. {kekik-1.7.4 → kekik-1.7.6}/Kekik/Sifreleme/AESManager.py +0 -0
  12. {kekik-1.7.4 → kekik-1.7.6}/Kekik/Sifreleme/CryptoJS.py +0 -0
  13. {kekik-1.7.4 → kekik-1.7.6}/Kekik/Sifreleme/HexCodec.py +0 -0
  14. {kekik-1.7.4 → kekik-1.7.6}/Kekik/Sifreleme/NaysHash.py +0 -0
  15. {kekik-1.7.4 → kekik-1.7.6}/Kekik/Sifreleme/StringCodec.py +0 -0
  16. {kekik-1.7.4 → kekik-1.7.6}/Kekik/Sifreleme/__init__.py +0 -0
  17. {kekik-1.7.4 → kekik-1.7.6}/Kekik/__init__.py +0 -0
  18. {kekik-1.7.4 → kekik-1.7.6}/Kekik/cache.py +0 -0
  19. {kekik-1.7.4 → kekik-1.7.6}/Kekik/cli.py +0 -0
  20. {kekik-1.7.4 → kekik-1.7.6}/Kekik/csv2dict.py +0 -0
  21. {kekik-1.7.4 → kekik-1.7.6}/Kekik/dict2csv.py +0 -0
  22. {kekik-1.7.4 → kekik-1.7.6}/Kekik/dict2json.py +0 -0
  23. {kekik-1.7.4 → kekik-1.7.6}/Kekik/dosya2set.py +0 -0
  24. {kekik-1.7.4 → kekik-1.7.6}/Kekik/dosya_indir.py +0 -0
  25. {kekik-1.7.4 → kekik-1.7.6}/Kekik/hwid_kontrol.py +0 -0
  26. {kekik-1.7.4 → kekik-1.7.6}/Kekik/kisi_ver/__init__.py +0 -0
  27. {kekik-1.7.4 → kekik-1.7.6}/Kekik/kisi_ver/biyografiler.py +0 -0
  28. {kekik-1.7.4 → kekik-1.7.6}/Kekik/kisi_ver/isimler.py +0 -0
  29. {kekik-1.7.4 → kekik-1.7.6}/Kekik/kisi_ver/soyisimler.py +0 -0
  30. {kekik-1.7.4 → kekik-1.7.6}/Kekik/link_islemleri.py +0 -0
  31. {kekik-1.7.4 → kekik-1.7.6}/Kekik/list2html.py +0 -0
  32. {kekik-1.7.4 → kekik-1.7.6}/Kekik/liste_fetis.py +0 -0
  33. {kekik-1.7.4 → kekik-1.7.6}/Kekik/mail_gonder.py +0 -0
  34. {kekik-1.7.4 → kekik-1.7.6}/Kekik/okunabilir_byte.py +0 -0
  35. {kekik-1.7.4 → kekik-1.7.6}/Kekik/proxy_ver.py +0 -0
  36. {kekik-1.7.4 → kekik-1.7.6}/Kekik/qr_ver.py +0 -0
  37. {kekik-1.7.4 → kekik-1.7.6}/Kekik/ses_fetis.py +0 -0
  38. {kekik-1.7.4 → kekik-1.7.6}/Kekik/slugify.py +0 -0
  39. {kekik-1.7.4 → kekik-1.7.6}/Kekik/terminal_baslik.py +0 -0
  40. {kekik-1.7.4 → kekik-1.7.6}/Kekik/txt_fetis.py +0 -0
  41. {kekik-1.7.4 → kekik-1.7.6}/Kekik/unicode_tr.py +0 -0
  42. {kekik-1.7.4 → kekik-1.7.6}/Kekik/zaman_donustur.py +0 -0
  43. {kekik-1.7.4 → kekik-1.7.6}/Kekik.egg-info/SOURCES.txt +0 -0
  44. {kekik-1.7.4 → kekik-1.7.6}/Kekik.egg-info/dependency_links.txt +0 -0
  45. {kekik-1.7.4 → kekik-1.7.6}/Kekik.egg-info/entry_points.txt +0 -0
  46. {kekik-1.7.4 → kekik-1.7.6}/Kekik.egg-info/top_level.txt +0 -0
  47. {kekik-1.7.4 → kekik-1.7.6}/LICENSE +0 -0
  48. {kekik-1.7.4 → kekik-1.7.6}/MANIFEST.in +0 -0
  49. {kekik-1.7.4 → kekik-1.7.6}/setup.cfg +0 -0
@@ -0,0 +1,199 @@
1
+ # ! Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
2
+
3
+ import re
4
+
5
+ class Packer:
6
+ """
7
+ P.A.C.K.E.R. sıkıştırma ve çözme işlemleri için kapsamlı bir sınıf.
8
+ ! » https://github.com/beautifier/js-beautify/blob/main/python/jsbeautifier/unpackers/packer.py
9
+ """
10
+
11
+ # Regex kalıpları - daha gevşek, farklı varyasyonları yakalayabilecek şekilde
12
+ PACKED_PATTERN = re.compile(
13
+ r"\}\s*\(\s*['\"](.*?)['\"],\s*(\d+),\s*(\d+),\s*['\"](.+?)['\"]\.split\(['\"]\\?\|['\"]\)",
14
+ re.IGNORECASE | re.MULTILINE | re.DOTALL
15
+ )
16
+
17
+ # Alternatif regex pattern, farklı formatlarda paketlenmiş kodu yakalamak için
18
+ ALTERNATIVE_PATTERNS = [
19
+ # Standart pattern
20
+ re.compile(
21
+ r"\}\('(.*)',\s*(\d+),\s*(\d+),\s*'(.*?)'\.split\('\|'\)",
22
+ re.IGNORECASE | re.MULTILINE | re.DOTALL
23
+ ),
24
+ # Daha gevşek pattern
25
+ re.compile(
26
+ r"\}\s*\(\s*['\"](.*?)['\"],\s*(\d+),\s*(\d+),\s*['\"](.+?)['\"]\.split\(['\"]\\?\|['\"]\)",
27
+ re.IGNORECASE | re.MULTILINE | re.DOTALL
28
+ ),
29
+ # Eval formatı
30
+ re.compile(
31
+ r"eval\(function\(p,a,c,k,e,(?:r|d|)\)\{.*?return p\}(.*?\.split\('\|'\))",
32
+ re.IGNORECASE | re.MULTILINE | re.DOTALL
33
+ )
34
+ ]
35
+
36
+ # Kelime değiştirme deseni
37
+ REPLACE_PATTERN = re.compile(
38
+ r"\b\w+\b",
39
+ re.IGNORECASE | re.MULTILINE
40
+ )
41
+
42
+ # Alfabeler
43
+ ALPHABET = {
44
+ 52: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP",
45
+ 54: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR",
46
+ 62: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
47
+ 95: " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
48
+ }
49
+
50
+ @staticmethod
51
+ def clean_escape_sequences(source: str) -> str:
52
+ """Kaçış dizilerini temizler."""
53
+ source = re.sub(r'\\\\', r'\\', source)
54
+ source = source.replace("\\'", "'")
55
+ source = source.replace('\\"', '"')
56
+ return source
57
+
58
+ @staticmethod
59
+ def extract_arguments(source: str) -> tuple[str, list[str], int, int]:
60
+ """P.A.C.K.E.R. formatındaki kaynak koddan argümanları çıkarır."""
61
+ # Önce standart pattern ile dene
62
+ match = Packer.PACKED_PATTERN.search(source)
63
+
64
+ # Eğer bulunamazsa, alternatif pattern'leri dene
65
+ if not match:
66
+ for pattern in Packer.ALTERNATIVE_PATTERNS:
67
+ match = pattern.search(source)
68
+ if match:
69
+ break
70
+
71
+ if not match:
72
+ # Son çare: daha serbest bir string arama
73
+ if "'.split('|')" in source or '".split("|")' in source:
74
+ # Manuel olarak parçalama işlemi yap
75
+ try:
76
+ # Basit bir yaklaşım, çoğu vakada çalışır
77
+ parts = re.findall(r"\((['\"](.*?)['\"],\s*(\d+),\s*(\d+),\s*['\"](.*?)['\"]\.split", source)
78
+ if parts:
79
+ payload, radix, count, symtab = parts[0][1:]
80
+ return payload, symtab.split("|"), int(radix), int(count)
81
+ except Exception:
82
+ pass
83
+
84
+ raise ValueError("Invalid P.A.C.K.E.R. source format. Pattern not found.")
85
+
86
+ # Eval formatını işle
87
+ if len(match.groups()) == 1:
88
+ # Eval formatı yakalandı, içeriği çıkar
89
+ eval_content = match.group(1)
90
+ if inner_match := re.search(r"\('(.*)',(\d+),(\d+),'(.*)'\)", eval_content):
91
+ payload, radix, count, symtab = inner_match.groups()
92
+ else:
93
+ raise ValueError("Cannot extract arguments from eval pattern")
94
+ else:
95
+ # Standart format yakalandı
96
+ payload, radix, count, symtab = match.groups()
97
+
98
+ return payload, symtab.split("|"), int(radix), int(count)
99
+
100
+ @staticmethod
101
+ def unbase(value: str, base: int) -> int:
102
+ """
103
+ Verilen değeri belirtilen tabandan ondalık sayıya dönüştürür.
104
+ Geniş taban desteği (2-95 arası) sağlar.
105
+ """
106
+ # Standart Python taban dönüşümü (2-36 arası)
107
+ if 2 <= base <= 36:
108
+ try:
109
+ return int(value, base)
110
+ except ValueError:
111
+ return 0
112
+
113
+ # Geniş taban desteği (37-95 arası)
114
+ if base > 95:
115
+ raise ValueError(f"Desteklenmeyen taban: {base}")
116
+
117
+ # Uygun alfabeyi seç
118
+ if base > 62:
119
+ selector = 95
120
+ elif base > 54:
121
+ selector = 62
122
+ elif base > 52:
123
+ selector = 54
124
+ else:
125
+ selector = 52
126
+
127
+ # Alfabeden karakter-indeks sözlüğü oluştur
128
+ char_dict = {char: idx for idx, char in enumerate(Packer.ALPHABET[selector])}
129
+
130
+ # Değeri dönüştür
131
+ result = 0
132
+ for index, char in enumerate(reversed(value)):
133
+ digit = char_dict.get(char, 0)
134
+ result += digit * (base ** index)
135
+
136
+ return result
137
+
138
+ @staticmethod
139
+ def lookup_symbol(match: re.Match, symtab: list[str], radix: int) -> str:
140
+ """Sembolleri arar ve yerine koyar."""
141
+ word = match[0]
142
+
143
+ try:
144
+ index = Packer.unbase(word, radix)
145
+ if 0 <= index < len(symtab):
146
+ replacement = symtab[index]
147
+ return replacement or word
148
+ except (ValueError, IndexError):
149
+ pass
150
+
151
+ return word
152
+
153
+ @staticmethod
154
+ def unpack(source: str) -> str:
155
+ """
156
+ P.A.C.K.E.R. formatındaki sıkıştırılmış bir JavaScript kodunu çözer.
157
+ Birden fazla format ve varyasyonu destekler.
158
+ """
159
+ # Kaçış dizilerini temizle
160
+ source = Packer.clean_escape_sequences(source)
161
+
162
+ # Argümanları çıkar
163
+ try:
164
+ payload, symtab, radix, count = Packer.extract_arguments(source)
165
+
166
+ # Sembol tablosunun doğruluğunu kontrol et (ancak sıkı değil)
167
+ if len(symtab) != count:
168
+ print(f"Uyarı: Sembol tablosu sayısı ({len(symtab)}) ile belirtilen sayı ({count}) eşleşmiyor, ancak devam ediliyor.")
169
+
170
+ # Kelimeleri değiştir ve sonucu döndür
171
+ return Packer.REPLACE_PATTERN.sub(
172
+ lambda match: Packer.lookup_symbol(match, symtab, radix),
173
+ payload
174
+ )
175
+ except Exception as e:
176
+ # Detaylı hata mesajı
177
+ raise ValueError(f"Unpacking failed: {str(e)}\nSource preview: {source[:100]}...")
178
+
179
+ @staticmethod
180
+ def detect_packed(source: str) -> bool:
181
+ """Verilen kodun P.A.C.K.E.R. formatında sıkıştırılmış olup olmadığını kontrol eder."""
182
+ # Standart pattern'i kontrol et
183
+ if Packer.PACKED_PATTERN.search(source):
184
+ return True
185
+
186
+ # Alternatif pattern'leri kontrol et
187
+ for pattern in Packer.ALTERNATIVE_PATTERNS:
188
+ if pattern.search(source):
189
+ return True
190
+
191
+ # Yaygın belirteçleri kontrol et
192
+ indicators = [
193
+ ".split('|')",
194
+ '.split("|")',
195
+ "function(p,a,c,k,e,",
196
+ "function(p, a, c, k, e, "
197
+ ]
198
+
199
+ return any(indicator in source for indicator in indicators)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: Kekik
3
- Version: 1.7.4
3
+ Version: 1.7.6
4
4
  Summary: İşlerimizi kolaylaştıracak fonksiyonların el altında durduğu kütüphane..
5
5
  Home-page: https://github.com/keyiflerolsun/Kekik
6
6
  Author: keyiflerolsun
@@ -26,6 +26,7 @@ Requires-Dist: simplejson
26
26
  Requires-Dist: rich
27
27
  Requires-Dist: tabulate
28
28
  Requires-Dist: pycryptodome
29
+ Requires-Dist: redis
29
30
  Dynamic: author
30
31
  Dynamic: author-email
31
32
  Dynamic: classifier
@@ -315,6 +316,11 @@ var played = 0;
315
316
  eval_jwSetup = re.compile(r'\};\s*(eval\(function[\s\S]*?)var played = \d+;').findall(veri)[0]
316
317
  print(Packer.unpack(Packer.unpack(eval_jwSetup)))
317
318
  # jwSetup.sources=[{"default":true,"file":"\x68\x74\x74\x70\x73\x3a\x2f\x2f\x64\x32\x2e\x69\x6d\x61\x67\x65\x73\x70\x6f\x74\x2e\x62\x75\x7a\x7a\x2f\x66\x32\x2f\x4e\x74\x4f\x31\x4e\x51\x5a\x6a\x44\x51\x41\x6b\x78\x6c\x58\x45\x47\x33\x6c\x62\x66\x62\x30\x31\x79\x74\x70\x57\x66\x4e\x30\x66\x62\x66\x50\x58\x5a\x55\x31\x6a\x50\x77\x5a\x6d\x48\x71\x58\x41\x37\x6c\x6d\x6d\x4b\x67\x47\x59\x31\x66\x47\x42\x6d\x6c\x38\x68\x32\x7a\x33\x4f\x5a\x69\x4f\x63\x4c\x6b\x51\x70\x7a\x57\x78\x4b\x45\x4c\x57\x42\x63\x79\x4d\x74\x75\x55\x44\x57\x46\x4e\x6c\x69\x64\x70\x46\x46\x65\x6e\x65\x64\x66\x48\x30\x69\x74\x66\x59\x67\x38\x52\x47\x41\x6b\x38\x6c\x76\x72\x31","label":"0","type":"hls","preload":"none"}];var mu=getLocation(jwSetup.sources[0].file);
319
+
320
+ # ! Veya
321
+
322
+ while Packer.detect_packed(veri):
323
+ veri = Packer.unpack(veri)
318
324
  ```
319
325
 
320
326
  ### **[CryptoJS](https://github.com/keyiflerolsun/Kekik/blob/main/Kekik/Sifreleme/CryptoJS.py)**
@@ -11,3 +11,4 @@ simplejson
11
11
  rich
12
12
  tabulate
13
13
  pycryptodome
14
+ redis
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: Kekik
3
- Version: 1.7.4
3
+ Version: 1.7.6
4
4
  Summary: İşlerimizi kolaylaştıracak fonksiyonların el altında durduğu kütüphane..
5
5
  Home-page: https://github.com/keyiflerolsun/Kekik
6
6
  Author: keyiflerolsun
@@ -26,6 +26,7 @@ Requires-Dist: simplejson
26
26
  Requires-Dist: rich
27
27
  Requires-Dist: tabulate
28
28
  Requires-Dist: pycryptodome
29
+ Requires-Dist: redis
29
30
  Dynamic: author
30
31
  Dynamic: author-email
31
32
  Dynamic: classifier
@@ -315,6 +316,11 @@ var played = 0;
315
316
  eval_jwSetup = re.compile(r'\};\s*(eval\(function[\s\S]*?)var played = \d+;').findall(veri)[0]
316
317
  print(Packer.unpack(Packer.unpack(eval_jwSetup)))
317
318
  # jwSetup.sources=[{"default":true,"file":"\x68\x74\x74\x70\x73\x3a\x2f\x2f\x64\x32\x2e\x69\x6d\x61\x67\x65\x73\x70\x6f\x74\x2e\x62\x75\x7a\x7a\x2f\x66\x32\x2f\x4e\x74\x4f\x31\x4e\x51\x5a\x6a\x44\x51\x41\x6b\x78\x6c\x58\x45\x47\x33\x6c\x62\x66\x62\x30\x31\x79\x74\x70\x57\x66\x4e\x30\x66\x62\x66\x50\x58\x5a\x55\x31\x6a\x50\x77\x5a\x6d\x48\x71\x58\x41\x37\x6c\x6d\x6d\x4b\x67\x47\x59\x31\x66\x47\x42\x6d\x6c\x38\x68\x32\x7a\x33\x4f\x5a\x69\x4f\x63\x4c\x6b\x51\x70\x7a\x57\x78\x4b\x45\x4c\x57\x42\x63\x79\x4d\x74\x75\x55\x44\x57\x46\x4e\x6c\x69\x64\x70\x46\x46\x65\x6e\x65\x64\x66\x48\x30\x69\x74\x66\x59\x67\x38\x52\x47\x41\x6b\x38\x6c\x76\x72\x31","label":"0","type":"hls","preload":"none"}];var mu=getLocation(jwSetup.sources[0].file);
319
+
320
+ # ! Veya
321
+
322
+ while Packer.detect_packed(veri):
323
+ veri = Packer.unpack(veri)
318
324
  ```
319
325
 
320
326
  ### **[CryptoJS](https://github.com/keyiflerolsun/Kekik/blob/main/Kekik/Sifreleme/CryptoJS.py)**
@@ -275,6 +275,11 @@ var played = 0;
275
275
  eval_jwSetup = re.compile(r'\};\s*(eval\(function[\s\S]*?)var played = \d+;').findall(veri)[0]
276
276
  print(Packer.unpack(Packer.unpack(eval_jwSetup)))
277
277
  # jwSetup.sources=[{"default":true,"file":"\x68\x74\x74\x70\x73\x3a\x2f\x2f\x64\x32\x2e\x69\x6d\x61\x67\x65\x73\x70\x6f\x74\x2e\x62\x75\x7a\x7a\x2f\x66\x32\x2f\x4e\x74\x4f\x31\x4e\x51\x5a\x6a\x44\x51\x41\x6b\x78\x6c\x58\x45\x47\x33\x6c\x62\x66\x62\x30\x31\x79\x74\x70\x57\x66\x4e\x30\x66\x62\x66\x50\x58\x5a\x55\x31\x6a\x50\x77\x5a\x6d\x48\x71\x58\x41\x37\x6c\x6d\x6d\x4b\x67\x47\x59\x31\x66\x47\x42\x6d\x6c\x38\x68\x32\x7a\x33\x4f\x5a\x69\x4f\x63\x4c\x6b\x51\x70\x7a\x57\x78\x4b\x45\x4c\x57\x42\x63\x79\x4d\x74\x75\x55\x44\x57\x46\x4e\x6c\x69\x64\x70\x46\x46\x65\x6e\x65\x64\x66\x48\x30\x69\x74\x66\x59\x67\x38\x52\x47\x41\x6b\x38\x6c\x76\x72\x31","label":"0","type":"hls","preload":"none"}];var mu=getLocation(jwSetup.sources[0].file);
278
+
279
+ # ! Veya
280
+
281
+ while Packer.detect_packed(veri):
282
+ veri = Packer.unpack(veri)
278
283
  ```
279
284
 
280
285
  ### **[CryptoJS](https://github.com/keyiflerolsun/Kekik/blob/main/Kekik/Sifreleme/CryptoJS.py)**
@@ -6,7 +6,7 @@ from io import open
6
6
  setup(
7
7
  # ? Genel Bilgiler
8
8
  name = "Kekik",
9
- version = "1.7.4",
9
+ version = "1.7.6",
10
10
  url = "https://github.com/keyiflerolsun/Kekik",
11
11
  description = "İşlerimizi kolaylaştıracak fonksiyonların el altında durduğu kütüphane..",
12
12
  keywords = ["Kekik", "KekikAkademi", "keyiflerolsun"],
@@ -44,7 +44,8 @@ setup(
44
44
  # "Pillow",
45
45
  # "notify-py",
46
46
  # "py3-validate-email"
47
- "pycryptodome"
47
+ "pycryptodome",
48
+ "redis"
48
49
  ],
49
50
 
50
51
  # ? Konsoldan Çalıştırılabilir
@@ -1,62 +0,0 @@
1
- # ! Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
2
-
3
- import re
4
-
5
- class Packer:
6
- """
7
- P.A.C.K.E.R. sıkıştırma ve çözme işlemleri için bir sınıf.
8
- ! » https://github.com/beautifier/js-beautify/blob/main/python/jsbeautifier/unpackers/packer.py
9
- """
10
- @staticmethod
11
- def clean_escape_sequences(source: str) -> str:
12
- """Kaçış dizilerini temizler."""
13
- source = re.sub(r'\\\\', r'\\', source)
14
- source = source.replace("\\'", "'")
15
- source = source.replace('\\"', '"')
16
- return source
17
-
18
- @staticmethod
19
- def extract_arguments(source: str) -> tuple[str, list[str], int, int]:
20
- """P.A.C.K.E.R. formatındaki kaynak koddan argümanları çıkarır."""
21
- match = re.search(r"}\('(.*)',(\d+),(\d+),'(.*)'\.split\('\|'\)", source, re.DOTALL)
22
-
23
- if not match:
24
- raise ValueError("Invalid P.A.C.K.E.R. source format.")
25
-
26
- payload, radix, count, symtab = match.groups()
27
-
28
- return payload, symtab.split("|"), int(radix), int(count)
29
-
30
- @staticmethod
31
- def convert_base(s: str, base: int) -> int:
32
- """Bir sayıyı belirli bir tabandan ondalık tabana çevirir."""
33
- alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
34
-
35
- return sum(alphabet.index(char) * (base**idx) for idx, char in enumerate(reversed(s)))
36
-
37
- @staticmethod
38
- def lookup_symbol(match: re.Match, symtab: list[str], radix: int) -> str:
39
- """Sembolleri arar ve yerine koyar."""
40
- word = match[0]
41
-
42
- return symtab[Packer.convert_base(word, radix)] or word
43
-
44
- @staticmethod
45
- def unpack(source: str) -> str:
46
- """P.A.C.K.E.R. formatındaki sıkıştırılmış bir kaynağı çözer."""
47
- source = Packer.clean_escape_sequences(source)
48
-
49
- payload, symtab, radix, count = Packer.extract_arguments(source)
50
-
51
- if count != len(symtab):
52
- raise ValueError("Malformed P.A.C.K.E.R. symtab.")
53
-
54
- return re.sub(r"\b\w+\b", lambda match: Packer.lookup_symbol(match, symtab, radix), payload)
55
-
56
- @staticmethod
57
- def pack(source: str, radix: int = 62) -> str:
58
- """Bir metni P.A.C.K.E.R. formatında sıkıştırır."""
59
- # Bu işlev, simgeleri ve sıkıştırılmış metni yeniden oluşturmak için bir yol sağlar.
60
- # Ancak bu, belirli bir algoritma veya sıkıştırma tekniğine bağlıdır.
61
- # Gerçekleştirilmesi zor olabilir çünkü P.A.C.K.E.R.'ın spesifik sıkıştırma mantığını takip etmek gerekir.
62
- raise NotImplementedError("Packing function is not implemented.")
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes