@jjlmoya/utils-developer 1.2.0

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.
Files changed (228) hide show
  1. package/package.json +64 -0
  2. package/src/category/i18n/en.ts +34 -0
  3. package/src/category/i18n/es.ts +34 -0
  4. package/src/category/i18n/fr.ts +34 -0
  5. package/src/category/index.ts +31 -0
  6. package/src/category/seo.astro +15 -0
  7. package/src/components/PreviewNavSidebar.astro +116 -0
  8. package/src/components/PreviewToolbar.astro +143 -0
  9. package/src/data.ts +11 -0
  10. package/src/env.d.ts +5 -0
  11. package/src/index.ts +78 -0
  12. package/src/layouts/PreviewLayout.astro +117 -0
  13. package/src/pages/[locale]/[slug].astro +146 -0
  14. package/src/pages/[locale].astro +251 -0
  15. package/src/pages/index.astro +4 -0
  16. package/src/tests/css_specificity_logic.test.ts +39 -0
  17. package/src/tests/faq_count.test.ts +19 -0
  18. package/src/tests/locale_completeness.test.ts +42 -0
  19. package/src/tests/mocks/astro_mock.js +2 -0
  20. package/src/tests/no_h1_in_components.test.ts +48 -0
  21. package/src/tests/schemas_fulfillment.test.ts +23 -0
  22. package/src/tests/seo_length.test.ts +22 -0
  23. package/src/tests/title_quality.test.ts +55 -0
  24. package/src/tests/tool_validation.test.ts +17 -0
  25. package/src/tool/aspectRatio/bibliography.astro +14 -0
  26. package/src/tool/aspectRatio/component.astro +468 -0
  27. package/src/tool/aspectRatio/i18n/en.ts +177 -0
  28. package/src/tool/aspectRatio/i18n/es.ts +177 -0
  29. package/src/tool/aspectRatio/i18n/fr.ts +177 -0
  30. package/src/tool/aspectRatio/index.ts +34 -0
  31. package/src/tool/aspectRatio/seo.astro +14 -0
  32. package/src/tool/aspectRatio/ui.ts +12 -0
  33. package/src/tool/calculadoraTiempoDatos/bibliography.astro +14 -0
  34. package/src/tool/calculadoraTiempoDatos/component.astro +829 -0
  35. package/src/tool/calculadoraTiempoDatos/i18n/en.ts +150 -0
  36. package/src/tool/calculadoraTiempoDatos/i18n/es.ts +163 -0
  37. package/src/tool/calculadoraTiempoDatos/i18n/fr.ts +150 -0
  38. package/src/tool/calculadoraTiempoDatos/index.ts +33 -0
  39. package/src/tool/calculadoraTiempoDatos/seo.astro +14 -0
  40. package/src/tool/calculadoraTiempoDatos/ui.ts +24 -0
  41. package/src/tool/colorConverter/bibliography.astro +14 -0
  42. package/src/tool/colorConverter/component.astro +504 -0
  43. package/src/tool/colorConverter/i18n/en.ts +126 -0
  44. package/src/tool/colorConverter/i18n/es.ts +126 -0
  45. package/src/tool/colorConverter/i18n/fr.ts +126 -0
  46. package/src/tool/colorConverter/index.ts +33 -0
  47. package/src/tool/colorConverter/seo.astro +14 -0
  48. package/src/tool/colorConverter/ui.ts +16 -0
  49. package/src/tool/conversorExcelCsvHtml/bibliography.astro +14 -0
  50. package/src/tool/conversorExcelCsvHtml/component.astro +595 -0
  51. package/src/tool/conversorExcelCsvHtml/i18n/en.ts +129 -0
  52. package/src/tool/conversorExcelCsvHtml/i18n/es.ts +129 -0
  53. package/src/tool/conversorExcelCsvHtml/i18n/fr.ts +129 -0
  54. package/src/tool/conversorExcelCsvHtml/index.ts +33 -0
  55. package/src/tool/conversorExcelCsvHtml/seo.astro +14 -0
  56. package/src/tool/conversorExcelCsvHtml/ui.ts +14 -0
  57. package/src/tool/cronGenerator/bibliography.astro +14 -0
  58. package/src/tool/cronGenerator/component.astro +667 -0
  59. package/src/tool/cronGenerator/i18n/en.ts +191 -0
  60. package/src/tool/cronGenerator/i18n/es.ts +191 -0
  61. package/src/tool/cronGenerator/i18n/fr.ts +191 -0
  62. package/src/tool/cronGenerator/index.ts +34 -0
  63. package/src/tool/cronGenerator/seo.astro +14 -0
  64. package/src/tool/cronGenerator/ui.ts +45 -0
  65. package/src/tool/cssSpecificityCalculator/bibliography.astro +14 -0
  66. package/src/tool/cssSpecificityCalculator/component.astro +292 -0
  67. package/src/tool/cssSpecificityCalculator/i18n/en.ts +168 -0
  68. package/src/tool/cssSpecificityCalculator/i18n/es.ts +168 -0
  69. package/src/tool/cssSpecificityCalculator/i18n/fr.ts +168 -0
  70. package/src/tool/cssSpecificityCalculator/index.ts +34 -0
  71. package/src/tool/cssSpecificityCalculator/logic.ts +100 -0
  72. package/src/tool/cssSpecificityCalculator/seo.astro +14 -0
  73. package/src/tool/cssSpecificityCalculator/ui-controller.ts +57 -0
  74. package/src/tool/cssSpecificityCalculator/ui.ts +11 -0
  75. package/src/tool/cssToInlineConverter/bibliography.astro +14 -0
  76. package/src/tool/cssToInlineConverter/component.astro +308 -0
  77. package/src/tool/cssToInlineConverter/i18n/en.ts +160 -0
  78. package/src/tool/cssToInlineConverter/i18n/es.ts +160 -0
  79. package/src/tool/cssToInlineConverter/i18n/fr.ts +160 -0
  80. package/src/tool/cssToInlineConverter/index.ts +34 -0
  81. package/src/tool/cssToInlineConverter/seo.astro +14 -0
  82. package/src/tool/cssToInlineConverter/ui.ts +12 -0
  83. package/src/tool/duplicateCssRemover/bibliography.astro +14 -0
  84. package/src/tool/duplicateCssRemover/component.astro +353 -0
  85. package/src/tool/duplicateCssRemover/i18n/en.ts +167 -0
  86. package/src/tool/duplicateCssRemover/i18n/es.ts +167 -0
  87. package/src/tool/duplicateCssRemover/i18n/fr.ts +167 -0
  88. package/src/tool/duplicateCssRemover/index.ts +34 -0
  89. package/src/tool/duplicateCssRemover/seo.astro +14 -0
  90. package/src/tool/duplicateCssRemover/ui.ts +12 -0
  91. package/src/tool/generadorSecurityTxt/bibliography.astro +14 -0
  92. package/src/tool/generadorSecurityTxt/component.astro +473 -0
  93. package/src/tool/generadorSecurityTxt/i18n/en.ts +173 -0
  94. package/src/tool/generadorSecurityTxt/i18n/es.ts +173 -0
  95. package/src/tool/generadorSecurityTxt/i18n/fr.ts +173 -0
  96. package/src/tool/generadorSecurityTxt/index.ts +33 -0
  97. package/src/tool/generadorSecurityTxt/seo.astro +14 -0
  98. package/src/tool/generadorSecurityTxt/ui.ts +27 -0
  99. package/src/tool/hashGenerator/bibliography.astro +14 -0
  100. package/src/tool/hashGenerator/component.astro +367 -0
  101. package/src/tool/hashGenerator/i18n/en.ts +118 -0
  102. package/src/tool/hashGenerator/i18n/es.ts +118 -0
  103. package/src/tool/hashGenerator/i18n/fr.ts +118 -0
  104. package/src/tool/hashGenerator/index.ts +33 -0
  105. package/src/tool/hashGenerator/md5.ts +138 -0
  106. package/src/tool/hashGenerator/seo.astro +14 -0
  107. package/src/tool/hashGenerator/ui.ts +11 -0
  108. package/src/tool/inspectorCertificadosSsl/bibliography.astro +14 -0
  109. package/src/tool/inspectorCertificadosSsl/component.astro +580 -0
  110. package/src/tool/inspectorCertificadosSsl/i18n/en.ts +214 -0
  111. package/src/tool/inspectorCertificadosSsl/i18n/es.ts +214 -0
  112. package/src/tool/inspectorCertificadosSsl/i18n/fr.ts +214 -0
  113. package/src/tool/inspectorCertificadosSsl/index.ts +33 -0
  114. package/src/tool/inspectorCertificadosSsl/seo.astro +14 -0
  115. package/src/tool/inspectorCertificadosSsl/ui.ts +29 -0
  116. package/src/tool/jsonFormatter/bibliography.astro +14 -0
  117. package/src/tool/jsonFormatter/component.astro +590 -0
  118. package/src/tool/jsonFormatter/i18n/en.ts +156 -0
  119. package/src/tool/jsonFormatter/i18n/es.ts +156 -0
  120. package/src/tool/jsonFormatter/i18n/fr.ts +156 -0
  121. package/src/tool/jsonFormatter/index.ts +34 -0
  122. package/src/tool/jsonFormatter/seo.astro +14 -0
  123. package/src/tool/jsonFormatter/ui.ts +15 -0
  124. package/src/tool/keycode/bibliography.astro +14 -0
  125. package/src/tool/keycode/component.astro +540 -0
  126. package/src/tool/keycode/i18n/en.ts +160 -0
  127. package/src/tool/keycode/i18n/es.ts +160 -0
  128. package/src/tool/keycode/i18n/fr.ts +160 -0
  129. package/src/tool/keycode/index.ts +34 -0
  130. package/src/tool/keycode/seo.astro +14 -0
  131. package/src/tool/keycode/ui.ts +10 -0
  132. package/src/tool/llmCostCalculator/bibliography.astro +14 -0
  133. package/src/tool/llmCostCalculator/component.astro +488 -0
  134. package/src/tool/llmCostCalculator/data.ts +99 -0
  135. package/src/tool/llmCostCalculator/i18n/en.ts +165 -0
  136. package/src/tool/llmCostCalculator/i18n/es.ts +165 -0
  137. package/src/tool/llmCostCalculator/i18n/fr.ts +165 -0
  138. package/src/tool/llmCostCalculator/index.ts +34 -0
  139. package/src/tool/llmCostCalculator/seo.astro +14 -0
  140. package/src/tool/llmCostCalculator/ui.ts +11 -0
  141. package/src/tool/mobileMockupGenerator/app.ts +614 -0
  142. package/src/tool/mobileMockupGenerator/bibliography.astro +14 -0
  143. package/src/tool/mobileMockupGenerator/component.astro +1044 -0
  144. package/src/tool/mobileMockupGenerator/constants.ts +48 -0
  145. package/src/tool/mobileMockupGenerator/i18n/en.ts +121 -0
  146. package/src/tool/mobileMockupGenerator/i18n/es.ts +121 -0
  147. package/src/tool/mobileMockupGenerator/i18n/fr.ts +121 -0
  148. package/src/tool/mobileMockupGenerator/index.ts +33 -0
  149. package/src/tool/mobileMockupGenerator/rendering.ts +189 -0
  150. package/src/tool/mobileMockupGenerator/seo.astro +14 -0
  151. package/src/tool/mobileMockupGenerator/store.ts +145 -0
  152. package/src/tool/mobileMockupGenerator/types.ts +41 -0
  153. package/src/tool/mobileMockupGenerator/ui.ts +48 -0
  154. package/src/tool/musicalTypography/bibliography.astro +14 -0
  155. package/src/tool/musicalTypography/component.astro +480 -0
  156. package/src/tool/musicalTypography/i18n/en.ts +179 -0
  157. package/src/tool/musicalTypography/i18n/es.ts +179 -0
  158. package/src/tool/musicalTypography/i18n/fr.ts +179 -0
  159. package/src/tool/musicalTypography/index.ts +33 -0
  160. package/src/tool/musicalTypography/seo.astro +14 -0
  161. package/src/tool/musicalTypography/ui.ts +25 -0
  162. package/src/tool/placeholderGenerator/bibliography.astro +14 -0
  163. package/src/tool/placeholderGenerator/component.astro +499 -0
  164. package/src/tool/placeholderGenerator/i18n/en.ts +176 -0
  165. package/src/tool/placeholderGenerator/i18n/es.ts +176 -0
  166. package/src/tool/placeholderGenerator/i18n/fr.ts +176 -0
  167. package/src/tool/placeholderGenerator/index.ts +34 -0
  168. package/src/tool/placeholderGenerator/seo.astro +14 -0
  169. package/src/tool/placeholderGenerator/ui.ts +14 -0
  170. package/src/tool/promptLibrary/bibliography.astro +14 -0
  171. package/src/tool/promptLibrary/component.astro +1131 -0
  172. package/src/tool/promptLibrary/controller.ts +49 -0
  173. package/src/tool/promptLibrary/i18n/en.ts +131 -0
  174. package/src/tool/promptLibrary/i18n/es.ts +131 -0
  175. package/src/tool/promptLibrary/i18n/fr.ts +126 -0
  176. package/src/tool/promptLibrary/index.ts +33 -0
  177. package/src/tool/promptLibrary/seo.astro +14 -0
  178. package/src/tool/promptLibrary/ui.ts +29 -0
  179. package/src/tool/readabilityCalculator/bibliography.astro +14 -0
  180. package/src/tool/readabilityCalculator/component.astro +534 -0
  181. package/src/tool/readabilityCalculator/i18n/en.ts +133 -0
  182. package/src/tool/readabilityCalculator/i18n/es.ts +133 -0
  183. package/src/tool/readabilityCalculator/i18n/fr.ts +133 -0
  184. package/src/tool/readabilityCalculator/index.ts +33 -0
  185. package/src/tool/readabilityCalculator/seo.astro +14 -0
  186. package/src/tool/readabilityCalculator/ui.ts +27 -0
  187. package/src/tool/svgSanitizer/bibliography.astro +14 -0
  188. package/src/tool/svgSanitizer/component.astro +554 -0
  189. package/src/tool/svgSanitizer/i18n/en.ts +125 -0
  190. package/src/tool/svgSanitizer/i18n/es.ts +125 -0
  191. package/src/tool/svgSanitizer/i18n/fr.ts +125 -0
  192. package/src/tool/svgSanitizer/index.ts +33 -0
  193. package/src/tool/svgSanitizer/seo.astro +14 -0
  194. package/src/tool/svgSanitizer/ui.ts +18 -0
  195. package/src/tool/svgToCss/bibliography.astro +14 -0
  196. package/src/tool/svgToCss/component.astro +381 -0
  197. package/src/tool/svgToCss/i18n/en.ts +174 -0
  198. package/src/tool/svgToCss/i18n/es.ts +174 -0
  199. package/src/tool/svgToCss/i18n/fr.ts +174 -0
  200. package/src/tool/svgToCss/index.ts +34 -0
  201. package/src/tool/svgToCss/seo.astro +14 -0
  202. package/src/tool/svgToCss/ui.ts +13 -0
  203. package/src/tool/urlCleaner/bibliography.astro +14 -0
  204. package/src/tool/urlCleaner/component.astro +458 -0
  205. package/src/tool/urlCleaner/i18n/en.ts +116 -0
  206. package/src/tool/urlCleaner/i18n/es.ts +116 -0
  207. package/src/tool/urlCleaner/i18n/fr.ts +116 -0
  208. package/src/tool/urlCleaner/index.ts +33 -0
  209. package/src/tool/urlCleaner/seo.astro +14 -0
  210. package/src/tool/urlCleaner/ui.ts +12 -0
  211. package/src/tool/urlEncoderDecoder/bibliography.astro +14 -0
  212. package/src/tool/urlEncoderDecoder/component.astro +291 -0
  213. package/src/tool/urlEncoderDecoder/i18n/en.ts +162 -0
  214. package/src/tool/urlEncoderDecoder/i18n/es.ts +162 -0
  215. package/src/tool/urlEncoderDecoder/i18n/fr.ts +162 -0
  216. package/src/tool/urlEncoderDecoder/index.ts +34 -0
  217. package/src/tool/urlEncoderDecoder/seo.astro +14 -0
  218. package/src/tool/urlEncoderDecoder/ui.ts +11 -0
  219. package/src/tool/utmGenerator/bibliography.astro +14 -0
  220. package/src/tool/utmGenerator/component.astro +270 -0
  221. package/src/tool/utmGenerator/i18n/en.ts +117 -0
  222. package/src/tool/utmGenerator/i18n/es.ts +117 -0
  223. package/src/tool/utmGenerator/i18n/fr.ts +117 -0
  224. package/src/tool/utmGenerator/index.ts +33 -0
  225. package/src/tool/utmGenerator/seo.astro +14 -0
  226. package/src/tool/utmGenerator/ui.ts +13 -0
  227. package/src/tools.ts +27 -0
  228. package/src/types.ts +72 -0
@@ -0,0 +1,118 @@
1
+ import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { HashGeneratorUI } from '../ui';
4
+
5
+ const slug = 'generateur-hashes';
6
+ const title = 'G\u00e9n\u00e9rateur de Hashes de S\u00e9curit\u00e9 en Ligne';
7
+ const description = 'Calculez des hashes MD5, SHA-1, SHA-256 et SHA-512 instantan\u00e9ment. Outil de s\u00e9curit\u00e9 gratuit, priv\u00e9 et ultra-rapide pour les d\u00e9veloppeurs. 100% C\u00f4t\u00e9 Client.';
8
+
9
+ const faqData = [
10
+ {
11
+ question: "Qu'est-ce qu'un hash et \u00e0 quoi sert-il?",
12
+ answer: "Un hash est une empreinte num\u00e9rique unique d'un texte ou d'un fichier. Il sert \u00e0 v\u00e9rifier que les donn\u00e9es n'ont pas \u00e9t\u00e9 alt\u00e9r\u00e9es et \u00e0 stocker les mots de passe de mani\u00e8re s\u00e9curis\u00e9e.",
13
+ },
14
+ {
15
+ question: 'Est-il s\u00fbr d\'utiliser ce g\u00e9n\u00e9rateur en ligne?',
16
+ answer: 'Oui, c\'est totalement s\u00fbr. Contrairement \u00e0 d\'autres sites, nous traitons le hash directement dans votre navigateur. Vos donn\u00e9es ne sont jamais envoy\u00e9es \u00e0 aucun serveur.',
17
+ },
18
+ {
19
+ question: 'Quel algorithme de hash devrais-je choisir?',
20
+ answer: 'Pour la s\u00e9curit\u00e9 moderne et le stockage de cl\u00e9s, nous recommandons SHA-256 ou SHA-512. MD5 et SHA-1 ne doivent \u00eatre utilis\u00e9s que pour la compatibilit\u00e9 avec les syst\u00e8mes h\u00e9rit\u00e9s.',
21
+ },
22
+ {
23
+ question: "Que signifie ajouter un 'Salt'?",
24
+ answer: "Un Salt est une cha\u00eene suppl\u00e9mentaire m\u00e9lang\u00e9e \u00e0 votre texte pour rendre le hash unique et beaucoup plus difficile \u00e0 d\u00e9chiffrer par des attaques par dictionnaire.",
25
+ },
26
+ ];
27
+
28
+ const howToData = [
29
+ { name: 'Saisir le texte', text: 'Tapez ou collez le texte que vous souhaitez hacher dans le champ de saisie.' },
30
+ { name: 'Configurer la s\u00e9curit\u00e9', text: 'Ajoutez un Salt optionnel ou augmentez les tours de traitement pour plus de robustesse.' },
31
+ { name: 'Obtenir les r\u00e9sultats', text: 'Les diff\u00e9rents hashes (MD5, SHA etc.) sont calcul\u00e9s en temps r\u00e9el pendant que vous tapez.' },
32
+ { name: 'Copier le hash', text: "Cliquez sur l'ic\u00f4ne de copie \u00e0 c\u00f4t\u00e9 de chaque algorithme pour le sauvegarder dans votre presse-papiers." },
33
+ ];
34
+
35
+ const faqSchema: WithContext<FAQPage> = {
36
+ '@context': 'https://schema.org',
37
+ '@type': 'FAQPage',
38
+ mainEntity: faqData.map((item) => ({
39
+ '@type': 'Question',
40
+ name: item.question,
41
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
42
+ })),
43
+ };
44
+
45
+ const howToSchema: WithContext<HowToThing> = {
46
+ '@context': 'https://schema.org',
47
+ '@type': 'HowTo',
48
+ name: title,
49
+ description,
50
+ step: howToData.map((s, i) => ({ '@type': 'HowToStep', position: i + 1, name: s.name, text: s.text })),
51
+ };
52
+
53
+ const appSchema: WithContext<SoftwareApplication> = {
54
+ '@context': 'https://schema.org',
55
+ '@type': 'SoftwareApplication',
56
+ name: title,
57
+ description,
58
+ applicationCategory: 'UtilityApplication',
59
+ operatingSystem: 'All',
60
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
61
+ inLanguage: 'fr',
62
+ };
63
+
64
+ const ui: HashGeneratorUI = {
65
+ labelInput: 'Texte d\'entr\u00e9e',
66
+ placeholderInput: 'Tapez ou collez le texte ici pour calculer ses hashes...',
67
+ labelSalt: 'Salt (Optionnel)',
68
+ placeholderSalt: 'Graine de s\u00e9curit\u00e9...',
69
+ labelRounds: 'Tours (Stretch)',
70
+ copyMd5: 'Copier MD5',
71
+ copySha1: 'Copier SHA-1',
72
+ copySha256: 'Copier SHA-256',
73
+ copySha512: 'Copier SHA-512',
74
+ };
75
+
76
+ export const content: ToolLocaleContent<HashGeneratorUI> = {
77
+ slug,
78
+ title,
79
+ description,
80
+ ui,
81
+ faqTitle: 'Questions Fr\u00e9quentes',
82
+ faq: faqData,
83
+ bibliographyTitle: 'Ressources Techniques sur le Hachage',
84
+ bibliography: [
85
+ { name: 'MDN Web Docs: SubtleCrypto.digest() API', url: 'https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest' },
86
+ { name: 'NIST: FIPS 180-4 Secure Hash Standard (SHA)', url: 'https://csrc.nist.gov/publications/detail/fips/180/4/final' },
87
+ { name: 'IETF: The MD5 Message-Digest Algorithm (RFC 1321)', url: 'https://datatracker.ietf.org/doc/html/rfc1321' },
88
+ ],
89
+ howTo: howToData,
90
+ schemas: [faqSchema, howToSchema, appSchema],
91
+ seo: [
92
+ { type: 'title', text: "Qu'est-ce qu'un Hash Cryptographique?", level: 2 },
93
+ {
94
+ type: 'paragraph',
95
+ html: 'Un <strong>hash cryptographique</strong> est une fonction math\u00e9matique qui transforme n\'importe quelle quantit\u00e9 de donn\u00e9es en une cha\u00eene de longueur fixe. La m\u00eame entr\u00e9e produit toujours le m\u00eame r\u00e9sultat, mais tout changement minimal dans l\'entr\u00e9e g\u00e9n\u00e8re un hash compl\u00e8tement diff\u00e9rent.',
96
+ },
97
+ { type: 'title', text: 'Algorithmes disponibles', level: 3 },
98
+ {
99
+ type: 'list',
100
+ items: [
101
+ '<strong>MD5 (128 bits):</strong> Rapide et largement support\u00e9. Consid\u00e9r\u00e9 non s\u00e9curis\u00e9 pour les mots de passe mais utile pour v\u00e9rifier l\'int\u00e9grit\u00e9 des fichiers dans des environnements non critiques.',
102
+ '<strong>SHA-1 (160 bits):</strong> D\u00e9pr\u00e9ci\u00e9 pour les usages critiques de s\u00e9curit\u00e9 depuis 2017. Encore pr\u00e9sent dans les syst\u00e8mes h\u00e9rit\u00e9s.',
103
+ '<strong>SHA-256 (256 bits):</strong> La norme actuelle pour la plupart des applications. Utilis\u00e9 dans Bitcoin, TLS et la signature de code.',
104
+ '<strong>SHA-512 (512 bits):</strong> Variante plus longue de SHA-2, id\u00e9ale lorsqu\'une r\u00e9sistance maximale aux collisions est requise.',
105
+ ],
106
+ },
107
+ { type: 'title', text: 'Salt et Key Stretching', level: 3 },
108
+ {
109
+ type: 'paragraph',
110
+ html: 'Le <strong>Salt</strong> est une cha\u00eene al\u00e9atoire ajout\u00e9e au texte avant de le hacher, garantissant que deux entr\u00e9es identiques produisent des hashes diff\u00e9rents. Le <strong>Key Stretching</strong> (tours) applique la fonction de hachage plusieurs fois pour rendre les attaques par force brute plus difficiles.',
111
+ },
112
+ { type: 'title', text: 'Confidentialit\u00e9 totale: 100% C\u00f4t\u00e9 Client', level: 3 },
113
+ {
114
+ type: 'paragraph',
115
+ html: 'Cet outil utilise l\'<strong>API Web Crypto</strong> du navigateur pour SHA et une impl\u00e9mentation TypeScript pure pour MD5. Tout le traitement se fait localement: vos donn\u00e9es ne quittent jamais votre appareil.',
116
+ },
117
+ ],
118
+ };
@@ -0,0 +1,33 @@
1
+ import type { DeveloperToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
+ import HashGeneratorComponent from './component.astro';
3
+ import HashGeneratorSEO from './seo.astro';
4
+ import HashGeneratorBibliography from './bibliography.astro';
5
+ import type { HashGeneratorUI } from './ui';
6
+
7
+ export type HashGeneratorLocaleContent = ToolLocaleContent<HashGeneratorUI>;
8
+
9
+ import { content as es } from './i18n/es';
10
+ import { content as en } from './i18n/en';
11
+ import { content as fr } from './i18n/fr';
12
+
13
+ export const hashGenerator: DeveloperToolEntry<HashGeneratorUI> = {
14
+ id: 'hash-generator',
15
+ icons: {
16
+ bg: 'mdi:shield-lock',
17
+ fg: 'mdi:pound',
18
+ },
19
+ i18n: {
20
+ es: async () => es,
21
+ en: async () => en,
22
+ fr: async () => fr,
23
+ },
24
+ };
25
+
26
+ export { HashGeneratorComponent, HashGeneratorSEO, HashGeneratorBibliography };
27
+
28
+ export const HASH_GENERATOR_TOOL: ToolDefinition = {
29
+ entry: hashGenerator,
30
+ Component: HashGeneratorComponent,
31
+ SEOComponent: HashGeneratorSEO,
32
+ BibliographyComponent: HashGeneratorBibliography,
33
+ };
@@ -0,0 +1,138 @@
1
+ type Fn3 = (y: number, z: number, w: number) => number;
2
+ type StepArgs = [number, number, number];
3
+ interface Md5State { a: number; b: number; c: number; d: number; }
4
+
5
+ const F: Fn3 = (y, z, w) => (y & z) | (~y & w);
6
+ const G: Fn3 = (y, z, w) => (y & w) | (z & ~w);
7
+ const H: Fn3 = (y, z, w) => y ^ z ^ w;
8
+ const I: Fn3 = (y, z, w) => z ^ (y | ~w);
9
+
10
+ function rotL(n: number, s: number): number {
11
+ return (n << s) | (n >>> (32 - s));
12
+ }
13
+
14
+ function step(s: Md5State, fn: Fn3, args: StepArgs): Md5State {
15
+ const [x, sh, k] = args;
16
+ const v = rotL((s.a + fn(s.b, s.c, s.d) + x + k) | 0, sh) + s.b;
17
+ return { a: s.d, b: v, c: s.b, d: s.c };
18
+ }
19
+
20
+ function round1(s: Md5State, x: number[]): Md5State {
21
+ s = step(s, F, [x[0], 7, -680876936]);
22
+ s = step(s, F, [x[1], 12, -389564586]);
23
+ s = step(s, F, [x[2], 17, 606105819]);
24
+ s = step(s, F, [x[3], 22, -1044525330]);
25
+ s = step(s, F, [x[4], 7, -176418897]);
26
+ s = step(s, F, [x[5], 12, 1200080426]);
27
+ s = step(s, F, [x[6], 17, -1473231341]);
28
+ s = step(s, F, [x[7], 22, -45705983]);
29
+ s = step(s, F, [x[8], 7, 1770035416]);
30
+ s = step(s, F, [x[9], 12, -1958414417]);
31
+ s = step(s, F, [x[10], 17, -42063]);
32
+ s = step(s, F, [x[11], 22, -1990404162]);
33
+ s = step(s, F, [x[12], 7, 1804603682]);
34
+ s = step(s, F, [x[13], 12, -40341101]);
35
+ s = step(s, F, [x[14], 17, -1502002290]);
36
+ s = step(s, F, [x[15], 22, 1236535329]);
37
+ return s;
38
+ }
39
+
40
+ function round2(s: Md5State, x: number[]): Md5State {
41
+ s = step(s, G, [x[1], 5, -165796510]);
42
+ s = step(s, G, [x[6], 9, -1069501632]);
43
+ s = step(s, G, [x[11], 14, 643717713]);
44
+ s = step(s, G, [x[0], 20, -373897302]);
45
+ s = step(s, G, [x[5], 5, -701558691]);
46
+ s = step(s, G, [x[10], 9, 38016083]);
47
+ s = step(s, G, [x[15], 14, -660478335]);
48
+ s = step(s, G, [x[4], 20, -405537848]);
49
+ s = step(s, G, [x[9], 5, 568446438]);
50
+ s = step(s, G, [x[14], 9, -1019803690]);
51
+ s = step(s, G, [x[3], 14, -187363961]);
52
+ s = step(s, G, [x[8], 20, 1163531501]);
53
+ s = step(s, G, [x[13], 5, -1444681467]);
54
+ s = step(s, G, [x[2], 9, -51403784]);
55
+ s = step(s, G, [x[7], 14, 1735328473]);
56
+ s = step(s, G, [x[12], 20, -1926607734]);
57
+ return s;
58
+ }
59
+
60
+ function round3(s: Md5State, x: number[]): Md5State {
61
+ s = step(s, H, [x[5], 4, -378558]);
62
+ s = step(s, H, [x[8], 11, -2022574463]);
63
+ s = step(s, H, [x[11], 16, 1839030562]);
64
+ s = step(s, H, [x[14], 23, -35309556]);
65
+ s = step(s, H, [x[1], 4, -1530992060]);
66
+ s = step(s, H, [x[4], 11, 1272893353]);
67
+ s = step(s, H, [x[7], 16, -155497632]);
68
+ s = step(s, H, [x[10], 23, -1094730640]);
69
+ s = step(s, H, [x[13], 4, 681279174]);
70
+ s = step(s, H, [x[0], 11, -358537222]);
71
+ s = step(s, H, [x[3], 16, -722521979]);
72
+ s = step(s, H, [x[6], 23, 76029189]);
73
+ s = step(s, H, [x[9], 4, -640364487]);
74
+ s = step(s, H, [x[12], 11, -421815835]);
75
+ s = step(s, H, [x[15], 16, 530742520]);
76
+ s = step(s, H, [x[2], 23, -995338651]);
77
+ return s;
78
+ }
79
+
80
+ function round4(s: Md5State, x: number[]): Md5State {
81
+ s = step(s, I, [x[0], 6, -198630844]);
82
+ s = step(s, I, [x[7], 10, 1126891415]);
83
+ s = step(s, I, [x[14], 15, -1416354905]);
84
+ s = step(s, I, [x[5], 21, -57434055]);
85
+ s = step(s, I, [x[12], 6, 1700485571]);
86
+ s = step(s, I, [x[3], 10, -1894986606]);
87
+ s = step(s, I, [x[10], 15, -1051523]);
88
+ s = step(s, I, [x[1], 21, -2054922799]);
89
+ s = step(s, I, [x[8], 6, 1873313359]);
90
+ s = step(s, I, [x[15], 10, -30611744]);
91
+ s = step(s, I, [x[6], 15, -1560198380]);
92
+ s = step(s, I, [x[13], 21, 1309151649]);
93
+ s = step(s, I, [x[4], 6, -145523070]);
94
+ s = step(s, I, [x[11], 10, -1120210379]);
95
+ s = step(s, I, [x[2], 15, 718787280]);
96
+ s = step(s, I, [x[9], 21, -343485551]);
97
+ return s;
98
+ }
99
+
100
+ function prepareInput(str: string): number[] {
101
+ const x: number[] = [];
102
+ const bytes = Array.from(new TextEncoder().encode(str));
103
+ for (let i = 0; i < bytes.length; i++) {
104
+ x[i >> 2] |= bytes[i] << ((i % 4) * 8);
105
+ }
106
+ x[bytes.length >> 2] |= 0x80 << ((bytes.length % 4) * 8);
107
+ x[(((bytes.length + 8) >> 6) << 4) + 14] = bytes.length * 8;
108
+ return x;
109
+ }
110
+
111
+ function processBlock(init: Md5State, x: number[]): Md5State {
112
+ let s = round1(init, x);
113
+ s = round2(s, x);
114
+ s = round3(s, x);
115
+ s = round4(s, x);
116
+ return { a: (s.a + init.a) | 0, b: (s.b + init.b) | 0, c: (s.c + init.c) | 0, d: (s.d + init.d) | 0 };
117
+ }
118
+
119
+ function stateToHex(state: Md5State): string {
120
+ const hexChars = '0123456789abcdef';
121
+ const vals = [state.a, state.b, state.c, state.d];
122
+ let hex = '';
123
+ for (const n of vals) {
124
+ for (let j = 0; j < 4; j++) {
125
+ hex += hexChars[(n >> (j * 8 + 4)) & 0x0f] + hexChars[(n >> (j * 8)) & 0x0f];
126
+ }
127
+ }
128
+ return hex;
129
+ }
130
+
131
+ export function md5(str: string): string {
132
+ const x = prepareInput(str);
133
+ let state: Md5State = { a: 1732584193, b: -271733879, c: -1732584194, d: 271733878 };
134
+ for (let i = 0; i < x.length; i += 16) {
135
+ state = processBlock(state, x.slice(i, i + 16));
136
+ }
137
+ return stateToHex(state);
138
+ }
@@ -0,0 +1,14 @@
1
+ ---
2
+ import { SEORenderer } from '@jjlmoya/utils-shared';
3
+ import { hashGenerator } from './index';
4
+ import type { KnownLocale } from '../../types';
5
+
6
+ interface Props {
7
+ locale?: KnownLocale;
8
+ }
9
+
10
+ const { locale = 'es' } = Astro.props;
11
+ const content = await hashGenerator.i18n[locale]?.();
12
+ ---
13
+
14
+ {content && <SEORenderer content={{ locale, sections: content.seo }} />}
@@ -0,0 +1,11 @@
1
+ export interface HashGeneratorUI extends Record<string, string> {
2
+ labelInput: string;
3
+ placeholderInput: string;
4
+ labelSalt: string;
5
+ placeholderSalt: string;
6
+ labelRounds: string;
7
+ copyMd5: string;
8
+ copySha1: string;
9
+ copySha256: string;
10
+ copySha512: string;
11
+ }
@@ -0,0 +1,14 @@
1
+ ---
2
+ import { Bibliography as SharedBibliography } from '@jjlmoya/utils-shared';
3
+ import { inspectorCertificadosSsl } from './index';
4
+ import type { KnownLocale } from '../../types';
5
+
6
+ interface Props {
7
+ locale?: KnownLocale;
8
+ }
9
+
10
+ const { locale = 'es' } = Astro.props;
11
+ const content = await inspectorCertificadosSsl.i18n[locale]?.();
12
+ ---
13
+
14
+ {content && <SharedBibliography links={content.bibliography} />}