Foro de elhacker.net

Programación => Desarrollo Web => Mensaje iniciado por: Diaf96 en 30 Marzo 2012, 22:28 pm



Título: como hacer traductor a binario.
Publicado por: Diaf96 en 30 Marzo 2012, 22:28 pm
 Hola, tengo que hacer un proyecto para tecnología y me gustaria hacer una pagina que sea un traductor de texto a binario y viceversa y subirlo a servidor gratuito, pero no se como hacerlo, que hago?


Título: Re: como hacer traductor a binario.
Publicado por: Diaf96 en 1 Abril 2012, 21:40 pm
Nadie sabe? es importante.


Título: Re: como hacer traductor a binario.
Publicado por: farresito en 1 Abril 2012, 22:20 pm
Programar HTML
Te has equivocado de post o va en serio? Ni la frase en si gramaticalmente tiene sentido.

Hola, tengo que hacer un proyecto para tecnología y me gustaria hacer una pagina que sea un traductor de texto a binario y viceversa y subirlo a servidor gratuito, pero no se como hacerlo, que hago?
Si sabes programar en un lenguaje web, ya sea PHP, javascript, etc. esto te ira muy bien: http://www.prepressure.com/library/technology/ascii_binary_hex

Lo que tienes que hacer es básicamente recorrer todo el string (cadena de texto) y segun la letra que encuentres, lo traduzca a una cifra o otra. Recuerda que el ASCII es una combinacion de 8 bits, lo que es lo mismo a un byte. Por lo tanto, 2^8, que son 256 combinaciones, el ASCII.

EDITO: He copiado el codigo fuente directamente de una pagina. Fijate en los condicionales y en el javascript. Examinalo y modificalo a tu medida. Pag. original: http://www.theskull.com/javascript/ascii-binary.html

Código
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2.  
  3. <html>
  4. <head>
  5. <title>Convert Binary to ASCII or ASCII to Binary</title>
  6. <style type="text/css">
  7. BODY {font:12px Arial;}
  8. a {text-decoration: none}
  9. TD.ts {font:24px Arial;font-weight:bold;text-align:center;}
  10. TD.ts1 {font:12px Arial;text-align:center;background-color:silver;}
  11. TD.ts2 {font:10px Arial;text-align:left;vertical-align:top;background-color:white;}
  12. TD.ts3 {font:10px Arial;text-align:center;vertical-align:top;background-color:white;}
  13. </style>
  14. </head>
  15.  
  16. <body text="black" link="blue" vlink="blue" alink="red">
  17. <script language="JavaScript1.2">
  18. // Conversion from Binary to ASCII or ASCII to Binary
  19. // Created by G. Marshall Brown
  20. // Copyright 2002 G. Marshall Brown
  21. // version 1.0 -- created 4/29/02
  22. // version 1.1 -- modified 12/04/02 Added many characters that weren't in version 1.0.
  23. // version XX -- modified --/--/--
  24. // All rights reserved, no modification without prior consent from creator.
  25. // Usage is free if Copyright statement remains intact.
  26. function dobin(text,sepa) {
  27. var letbin = ""
  28. for (i=0; i<text.length;i++) {
  29.  
  30. let = text.substr(i,1);
  31. if (i>0) {
  32. var sep = sepa;
  33. if (i % 10 == 0) {
  34. letbin=letbin+'<BR>'
  35. }
  36. }
  37. else {
  38. var sep = "";
  39. }
  40.  
  41. //Ascii -- Binary Code
  42. if (let ==  "A") {letbin = letbin + sep + '01000001'}
  43. if (let ==  "B") {letbin = letbin + sep + '01000010'}
  44. if (let ==  "C") {letbin = letbin + sep + '01000011'}
  45. if (let ==  "D") {letbin = letbin + sep + '01000100'}
  46. if (let ==  "E") {letbin = letbin + sep + '01000101'}
  47. if (let ==  "F") {letbin = letbin + sep + '01000110'}
  48. if (let ==  "G") {letbin = letbin + sep + '01000111'}
  49. if (let ==  "H") {letbin = letbin + sep + '01001000'}
  50. if (let ==  "I") {letbin = letbin + sep + '01001001'}
  51. if (let ==  "J") {letbin = letbin + sep + '01001010'}
  52. if (let ==  "K") {letbin = letbin + sep + '01001011'}
  53. if (let ==  "L") {letbin = letbin + sep + '01001100'}
  54. if (let ==  "M") {letbin = letbin + sep + '01001101'}
  55. if (let ==  "N") {letbin = letbin + sep + '01001110'}
  56. if (let ==  "O") {letbin = letbin + sep + '01001111'}
  57. if (let ==  "P") {letbin = letbin + sep + '01010000'}
  58. if (let ==  "Q") {letbin = letbin + sep + '01010001'}
  59. if (let ==  "R") {letbin = letbin + sep + '01010010'}
  60. if (let ==  "S") {letbin = letbin + sep + '01010011'}
  61. if (let ==  "T") {letbin = letbin + sep + '01010100'}
  62. if (let ==  "U") {letbin = letbin + sep + '01010101'}
  63. if (let ==  "V") {letbin = letbin + sep + '01010110'}
  64. if (let ==  "W") {letbin = letbin + sep + '01010111'}
  65. if (let ==  "X") {letbin = letbin + sep + '01011000'}
  66. if (let ==  "Y") {letbin = letbin + sep + '01011001'}
  67. if (let ==  "Z") {letbin = letbin + sep + '01011010'}
  68. if (let ==  "a") {letbin = letbin + sep + '01100001'}
  69. if (let ==  "b") {letbin = letbin + sep + '01100010'}
  70. if (let ==  "c") {letbin = letbin + sep + '01100011'}
  71. if (let ==  "d") {letbin = letbin + sep + '01100100'}
  72. if (let ==  "e") {letbin = letbin + sep + '01100101'}
  73. if (let ==  "f") {letbin = letbin + sep + '01100110'}
  74. if (let ==  "g") {letbin = letbin + sep + '01100111'}
  75. if (let ==  "h") {letbin = letbin + sep + '01101000'}
  76. if (let ==  "i") {letbin = letbin + sep + '01101001'}
  77. if (let ==  "j") {letbin = letbin + sep + '01101010'}
  78. if (let ==  "k") {letbin = letbin + sep + '01101011'}
  79. if (let ==  "l") {letbin = letbin + sep + '01101100'}
  80. if (let ==  "m") {letbin = letbin + sep + '01101101'}
  81. if (let ==  "n") {letbin = letbin + sep + '01101110'}
  82. if (let ==  "o") {letbin = letbin + sep + '01101111'}
  83. if (let ==  "p") {letbin = letbin + sep + '01110000'}
  84. if (let ==  "q") {letbin = letbin + sep + '01110001'}
  85. if (let ==  "r") {letbin = letbin + sep + '01110010'}
  86. if (let ==  "s") {letbin = letbin + sep + '01110011'}
  87. if (let ==  "t") {letbin = letbin + sep + '01110100'}
  88. if (let ==  "u") {letbin = letbin + sep + '01110101'}
  89. if (let ==  "v") {letbin = letbin + sep + '01110110'}
  90. if (let ==  "w") {letbin = letbin + sep + '01110111'}
  91. if (let ==  "x") {letbin = letbin + sep + '01111000'}
  92. if (let ==  "y") {letbin = letbin + sep + '01111001'}
  93. if (let ==  "z") {letbin = letbin + sep + '01111010'}
  94. if (let ==  " ") {letbin = letbin + sep + '00100000'}
  95.  
  96. //Numbers:
  97. if (let ==  "0") {letbin = letbin + sep + '00110000'}
  98. if (let ==  "1") {letbin = letbin + sep + '00110001'}
  99. if (let ==  "2") {letbin = letbin + sep + '00110010'}
  100. if (let ==  "3") {letbin = letbin + sep + '00110011'}
  101. if (let ==  "4") {letbin = letbin + sep + '00110100'}
  102. if (let ==  "5") {letbin = letbin + sep + '00110101'}
  103. if (let ==  "6") {letbin = letbin + sep + '00110110'}
  104. if (let ==  "7") {letbin = letbin + sep + '00110111'}
  105. if (let ==  "8") {letbin = letbin + sep + '00111000'}
  106. if (let ==  "9") {letbin = letbin + sep + '00111001'}
  107.  
  108. //Special Characters:
  109. if (let ==  "!") {letbin = letbin + sep + '00100001'}
  110. if (let ==  "\"") {letbin = letbin + sep + '00100010'}
  111. if (let ==  "#") {letbin = letbin + sep + '00100011'}
  112. if (let ==  "$") {letbin = letbin + sep + '00100100'}
  113. if (let ==  "%") {letbin = letbin + sep + '00100101'}
  114. if (let ==  "&") {letbin = letbin + sep + '00100110'}
  115. if (let ==  "'") {letbin = letbin + sep + '00100111'}
  116. if (let ==  "(") {letbin = letbin + sep + '00101000'}
  117. if (let ==  ")") {letbin = letbin + sep + '00101001'}
  118. if (let ==  "*") {letbin = letbin + sep + '00101010'}
  119. if (let ==  "+") {letbin = letbin + sep + '00101011'}
  120. if (let ==  ",") {letbin = letbin + sep + '00101100'}
  121. if (let ==  "-") {letbin = letbin + sep + '00101101'}
  122. if (let ==  ".") {letbin = letbin + sep + '00101110'}
  123. if (let ==  "/") {letbin = letbin + sep + '00101111'}
  124. if (let ==  ":") {letbin = letbin + sep + '00111010'}
  125. if (let ==  ";") {letbin = letbin + sep + '00111011'}
  126. if (let ==  "<") {letbin = letbin + sep + '00111100'}
  127. if (let ==  "=") {letbin = letbin + sep + '00111101'}
  128. if (let ==  ">") {letbin = letbin + sep + '00111110'}
  129. if (let ==  "?") {letbin = letbin + sep + '00111111'}
  130. if (let ==  "@") {letbin = letbin + sep + '01000000'}
  131. if (let ==  "[") {letbin = letbin + sep + '01011011'}
  132. if (let ==  "\\") {letbin = letbin + sep + '01011100'}
  133. if (let ==  "]") {letbin = letbin + sep + '01011101'}
  134. if (let ==  "^") {letbin = letbin + sep + '01011110'}
  135. if (let ==  "_") {letbin = letbin + sep + '01011111'}
  136. if (let ==  "`") {letbin = letbin + sep + '01100000'}
  137. if (let ==  "{") {letbin = letbin + sep + '01111011'}
  138. if (let ==  "|") {letbin = letbin + sep + '01111100'}
  139. if (let ==  "}") {letbin = letbin + sep + '01111101'}
  140. if (let ==  "~") {letbin = letbin + sep + '01111110'}
  141. if (let ==  "€") {letbin = letbin + sep + '10000000'}
  142. if (let ==  "¡") {letbin = letbin + sep + '10100001'}
  143. if (let ==  "¢") {letbin = letbin + sep + '10100010'}
  144. if (let ==  "£") {letbin = letbin + sep + '10100011'}
  145. if (let ==  "¤") {letbin = letbin + sep + '10100100'}
  146. if (let ==  "¥") {letbin = letbin + sep + '10100101'}
  147. if (let ==  "¦") {letbin = letbin + sep + '10100110'}
  148. if (let ==  "§") {letbin = letbin + sep + '10100111'}
  149. if (let ==  "¨") {letbin = letbin + sep + '10100111'}
  150. if (let ==  "©") {letbin = letbin + sep + '10101001'}
  151. if (let ==  "ª") {letbin = letbin + sep + '10101010'}
  152. if (let ==  "«") {letbin = letbin + sep + '10101011'}
  153. if (let ==  "¬") {letbin = letbin + sep + '10101100'}
  154. if (let ==  "­") {letbin = letbin + sep + '10101101'}
  155. if (let ==  "®") {letbin = letbin + sep + '10101110'}
  156. if (let ==  "¯") {letbin = letbin + sep + '10101111'}
  157. if (let ==  "°") {letbin = letbin + sep + '10110000'}
  158. if (let ==  "±") {letbin = letbin + sep + '10110001'}
  159. if (let ==  "²") {letbin = letbin + sep + '10110010'}
  160. if (let ==  "³") {letbin = letbin + sep + '10110011'}
  161. if (let ==  "´") {letbin = letbin + sep + '10110100'}
  162. if (let ==  "µ") {letbin = letbin + sep + '10110101'}
  163. if (let ==  "¶") {letbin = letbin + sep + '10110110'}
  164. if (let ==  "·") {letbin = letbin + sep + '10110111'}
  165. if (let ==  "¸") {letbin = letbin + sep + '10111000'}
  166. if (let ==  "¹") {letbin = letbin + sep + '10111001'}
  167. if (let ==  "º") {letbin = letbin + sep + '10111010'}
  168. if (let ==  "»") {letbin = letbin + sep + '10111011'}
  169. if (let ==  "¼") {letbin = letbin + sep + '10111100'}
  170. if (let ==  "½") {letbin = letbin + sep + '10111101'}
  171. if (let ==  "¾") {letbin = letbin + sep + '10111110'}
  172. if (let ==  "¿") {letbin = letbin + sep + '10111111'}
  173. if (let ==  "À") {letbin = letbin + sep + '11000000'}
  174. if (let ==  "Á") {letbin = letbin + sep + '11000001'}
  175. if (let ==  "") {letbin = letbin + sep + '11000010'}
  176. if (let ==  "Ã") {letbin = letbin + sep + '11000011'}
  177. if (let ==  "Ä") {letbin = letbin + sep + '11000100'}
  178. if (let ==  "Å") {letbin = letbin + sep + '11000101'}
  179. if (let ==  "Æ") {letbin = letbin + sep + '11000110'}
  180. if (let ==  "Ç") {letbin = letbin + sep + '11000111'}
  181. if (let ==  "È") {letbin = letbin + sep + '11001000'}
  182. if (let ==  "É") {letbin = letbin + sep + '11001001'}
  183. if (let ==  "Ê") {letbin = letbin + sep + '11001010'}
  184. if (let ==  "Ë") {letbin = letbin + sep + '11001011'}
  185. if (let ==  "Ì") {letbin = letbin + sep + '11001100'}
  186. if (let ==  "Í") {letbin = letbin + sep + '11001101'}
  187. if (let ==  "Î") {letbin = letbin + sep + '11001110'}
  188. if (let ==  "Ï") {letbin = letbin + sep + '11001111'}
  189. if (let ==  "Ð") {letbin = letbin + sep + '11010000'}
  190. if (let ==  "Ñ") {letbin = letbin + sep + '11010001'}
  191. if (let ==  "Ò") {letbin = letbin + sep + '11010010'}
  192. if (let ==  "Ó") {letbin = letbin + sep + '11010011'}
  193. if (let ==  "Ô") {letbin = letbin + sep + '11010100'}
  194. if (let ==  "Õ") {letbin = letbin + sep + '11010101'}
  195. if (let ==  "Ö") {letbin = letbin + sep + '11010110'}
  196. if (let ==  "×") {letbin = letbin + sep + '11010111'}
  197. if (let ==  "Ø") {letbin = letbin + sep + '11011000'}
  198. if (let ==  "Ù") {letbin = letbin + sep + '11011001'}
  199. if (let ==  "Ú") {letbin = letbin + sep + '11011010'}
  200. if (let ==  "Û") {letbin = letbin + sep + '11011011'}
  201. if (let ==  "Ü") {letbin = letbin + sep + '11011100'}
  202. if (let ==  "Ý") {letbin = letbin + sep + '11011101'}
  203. if (let ==  "Þ") {letbin = letbin + sep + '11011110'}
  204. if (let ==  "ß") {letbin = letbin + sep + '11011111'}
  205. if (let ==  "à") {letbin = letbin + sep + '11100000'}
  206. if (let ==  "á") {letbin = letbin + sep + '11100001'}
  207. if (let ==  "") {letbin = letbin + sep + '11100010'}
  208. if (let ==  "ã") {letbin = letbin + sep + '11100011'}
  209. if (let ==  "ä") {letbin = letbin + sep + '11100100'}
  210. if (let ==  "å") {letbin = letbin + sep + '11100101'}
  211. if (let ==  "æ") {letbin = letbin + sep + '11100110'}
  212. if (let ==  "ç") {letbin = letbin + sep + '11100111'}
  213. if (let ==  "è") {letbin = letbin + sep + '11101000'}
  214. if (let ==  "é") {letbin = letbin + sep + '11101001'}
  215. if (let ==  "ê") {letbin = letbin + sep + '11101010'}
  216. if (let ==  "ë") {letbin = letbin + sep + '11101011'}
  217. if (let ==  "ì") {letbin = letbin + sep + '11101100'}
  218. if (let ==  "í") {letbin = letbin + sep + '11101101'}
  219. if (let ==  "î") {letbin = letbin + sep + '11101110'}
  220. if (let ==  "ï") {letbin = letbin + sep + '11101111'}
  221. if (let ==  "ð") {letbin = letbin + sep + '11110000'}
  222. if (let ==  "ñ") {letbin = letbin + sep + '11110001'}
  223. if (let ==  "ò") {letbin = letbin + sep + '11110010'}
  224. if (let ==  "ó") {letbin = letbin + sep + '11110011'}
  225. if (let ==  "ô") {letbin = letbin + sep + '11110100'}
  226. if (let ==  "õ") {letbin = letbin + sep + '11110101'}
  227. if (let ==  "ö") {letbin = letbin + sep + '11110110'}
  228. if (let ==  "÷") {letbin = letbin + sep + '11110111'}
  229. if (let ==  "ø") {letbin = letbin + sep + '11111000'}
  230. if (let ==  "ù") {letbin = letbin + sep + '11111001'}
  231. if (let ==  "ú") {letbin = letbin + sep + '11111010'}
  232. if (let ==  "û") {letbin = letbin + sep + '11111011'}
  233. if (let ==  "û") {letbin = letbin + sep + '11111100'}
  234. if (let ==  "ý") {letbin = letbin + sep + '11111101'}
  235. if (let ==  "þ") {letbin = letbin + sep + '11111110'}
  236. if (let ==  "ÿ") {letbin = letbin + sep + '11111111'}
  237.  
  238. }
  239. binary.innerHTML = letbin
  240. return false;
  241. }
  242.  
  243. function doasc(text) {
  244.  
  245. if (text.length % 8 != 0) {
  246. alert (text + " is not an even binary.\n\nYou may have missed a digit or maybe added an additional digit/character.\n\nSeparaters are NOT required here.")
  247. return false;
  248. last;
  249. }
  250. var letasc = ""
  251. lettot = text.length / 8
  252. j=0
  253. for (i=0; i<lettot;i++) {
  254.  
  255. let = text.substr(j,8);
  256.  
  257.  
  258.  
  259. if (let ==  "01000001") {letasc = letasc + 'A'}
  260. if (let ==  "01000010") {letasc = letasc + 'B'}
  261. if (let ==  "01000011") {letasc = letasc + 'C'}
  262. if (let ==  "01000100") {letasc = letasc + 'D'}
  263. if (let ==  "01000101") {letasc = letasc + 'E'}
  264. if (let ==  "01000110") {letasc = letasc + 'F'}
  265. if (let ==  "01000111") {letasc = letasc + 'G'}
  266. if (let ==  "01001000") {letasc = letasc + 'H'}
  267. if (let ==  "01001001") {letasc = letasc + 'I'}
  268. if (let ==  "01001010") {letasc = letasc + 'J'}
  269. if (let ==  "01001011") {letasc = letasc + 'K'}
  270. if (let ==  "01001100") {letasc = letasc + 'L'}
  271. if (let ==  "01001101") {letasc = letasc + 'M'}
  272. if (let ==  "01001110") {letasc = letasc + 'N'}
  273. if (let ==  "01001111") {letasc = letasc + 'O'}
  274. if (let ==  "01010000") {letasc = letasc + 'P'}
  275. if (let ==  "01010001") {letasc = letasc + 'Q'}
  276. if (let ==  "01010010") {letasc = letasc + 'R'}
  277. if (let ==  "01010011") {letasc = letasc + 'S'}
  278. if (let ==  "01010100") {letasc = letasc + 'T'}
  279. if (let ==  "01010101") {letasc = letasc + 'U'}
  280. if (let ==  "01010110") {letasc = letasc + 'V'}
  281. if (let ==  "01010111") {letasc = letasc + 'W'}
  282. if (let ==  "01011000") {letasc = letasc + 'X'}
  283. if (let ==  "01011001") {letasc = letasc + 'Y'}
  284. if (let ==  "01011010") {letasc = letasc + 'Z'}
  285. if (let ==  "01100001") {letasc = letasc + 'a'}
  286. if (let ==  "01100010") {letasc = letasc + 'b'}
  287. if (let ==  "01100011") {letasc = letasc + 'c'}
  288. if (let ==  "01100100") {letasc = letasc + 'd'}
  289. if (let ==  "01100101") {letasc = letasc + 'e'}
  290. if (let ==  "01100110") {letasc = letasc + 'f'}
  291. if (let ==  "01100111") {letasc = letasc + 'g'}
  292. if (let ==  "01101000") {letasc = letasc + 'h'}
  293. if (let ==  "01101001") {letasc = letasc + 'i'}
  294. if (let ==  "01101010") {letasc = letasc + 'j'}
  295. if (let ==  "01101011") {letasc = letasc + 'k'}
  296. if (let ==  "01101100") {letasc = letasc + 'l'}
  297. if (let ==  "01101101") {letasc = letasc + 'm'}
  298. if (let ==  "01101110") {letasc = letasc + 'n'}
  299. if (let ==  "01101111") {letasc = letasc + 'o'}
  300. if (let ==  "01110000") {letasc = letasc + 'p'}
  301. if (let ==  "01110001") {letasc = letasc + 'q'}
  302. if (let ==  "01110010") {letasc = letasc + 'r'}
  303. if (let ==  "01110011") {letasc = letasc + 's'}
  304. if (let ==  "01110100") {letasc = letasc + 't'}
  305. if (let ==  "01110101") {letasc = letasc + 'u'}
  306. if (let ==  "01110110") {letasc = letasc + 'v'}
  307. if (let ==  "01110111") {letasc = letasc + 'w'}
  308. if (let ==  "01111000") {letasc = letasc + 'x'}
  309. if (let ==  "01111001") {letasc = letasc + 'y'}
  310. if (let ==  "01111010") {letasc = letasc + 'z'}
  311. if (let ==  "00100000") {letasc = letasc + ' '}
  312.  
  313. //Numbers:
  314. if (let ==  "00110000") {letasc = letasc + '0'}
  315. if (let ==  "00110001") {letasc = letasc + '1'}
  316. if (let ==  "00110010") {letasc = letasc + '2'}
  317. if (let ==  "00110011") {letasc = letasc + '3'}
  318. if (let ==  "00110100") {letasc = letasc + '4'}
  319. if (let ==  "00110101") {letasc = letasc + '5'}
  320. if (let ==  "00110110") {letasc = letasc + '6'}
  321. if (let ==  "00110111") {letasc = letasc + '7'}
  322. if (let ==  "00111000") {letasc = letasc + '8'}
  323. if (let ==  "00111001") {letasc = letasc + '9'}
  324.  
  325. //Special Characters:
  326. if (let ==  "00100001") {letasc = letasc + '!'}
  327. if (let ==  "00100010") {letasc = letasc + '\"'}
  328. if (let ==  "00100011") {letasc = letasc + '#'}
  329. if (let ==  "00100100") {letasc = letasc + '$'}
  330. if (let ==  "00100101") {letasc = letasc + '%'}
  331. if (let ==  "00100110") {letasc = letasc + '&'}
  332. if (let ==  "00100111") {letasc = letasc + '\''}
  333. if (let ==  "00101000") {letasc = letasc + '('}
  334. if (let ==  "00101001") {letasc = letasc + ')'}
  335. if (let ==  "00101010") {letasc = letasc + '*'}
  336. if (let ==  "00101011") {letasc = letasc + '+'}
  337. if (let ==  "00101100") {letasc = letasc + ','}
  338. if (let ==  "00101101") {letasc = letasc + '-'}
  339. if (let ==  "00101110") {letasc = letasc + '.'}
  340. if (let ==  "00101111") {letasc = letasc + '/'}
  341. if (let ==  "00111010") {letasc = letasc + ':'}
  342. if (let ==  "00111011") {letasc = letasc + ';'}
  343. if (let ==  "00111100") {letasc = letasc + '<'}
  344. if (let ==  "00111101") {letasc = letasc + '='}
  345. if (let ==  "00111110") {letasc = letasc + '>'}
  346. if (let ==  "00111111") {letasc = letasc + '?'}
  347. if (let ==  "01000000") {letasc = letasc + '@'}
  348. if (let ==  "01011011") {letasc = letasc + '['}
  349. if (let ==  "01011100") {letasc = letasc + '\\'}
  350. if (let ==  "01011101") {letasc = letasc + ']'}
  351. if (let ==  "01011110") {letasc = letasc + '^'}
  352. if (let ==  "01011111") {letasc = letasc + '_'}
  353. if (let ==  "01100000") {letasc = letasc + '`'}
  354. if (let ==  "01111011") {letasc = letasc + '{'}
  355. if (let ==  "01111100") {letasc = letasc + '|'}
  356. if (let ==  "01111101") {letasc = letasc + '}'}
  357. if (let ==  "01111110") {letasc = letasc + '~'}
  358. if (let ==  "10000000") {letasc = letasc + '€'}
  359. if (let ==  "10100001") {letasc = letasc + '¡'}
  360. if (let ==  "10100010") {letasc = letasc + '¢'}
  361. if (let ==  "10100011") {letasc = letasc + '£'}
  362. if (let ==  "10100100") {letasc = letasc + '¤'}
  363. if (let ==  "10100101") {letasc = letasc + '¥'}
  364. if (let ==  "10100110") {letasc = letasc + '¦'}
  365. if (let ==  "10100111") {letasc = letasc + '§'}
  366. if (let ==  "10100111") {letasc = letasc + '¨'}
  367. if (let ==  "10101001") {letasc = letasc + '©'}
  368. if (let ==  "10101010") {letasc = letasc + 'ª'}
  369. if (let ==  "10101011") {letasc = letasc + '«'}
  370. if (let ==  "10101100") {letasc = letasc + '¬'}
  371. if (let ==  "10101101") {letasc = letasc + '­'}
  372. if (let ==  "10101110") {letasc = letasc + '®'}
  373. if (let ==  "10101111") {letasc = letasc + '¯'}
  374. if (let ==  "10110000") {letasc = letasc + '°'}
  375. if (let ==  "10110001") {letasc = letasc + '±'}
  376. if (let ==  "10110010") {letasc = letasc + '²'}
  377. if (let ==  "10110011") {letasc = letasc + '³'}
  378. if (let ==  "10110100") {letasc = letasc + '´'}
  379. if (let ==  "10110101") {letasc = letasc + 'µ'}
  380. if (let ==  "10110110") {letasc = letasc + '¶'}
  381. if (let ==  "10110111") {letasc = letasc + '·'}
  382. if (let ==  "10111000") {letasc = letasc + '¸'}
  383. if (let ==  "10111001") {letasc = letasc + '¹'}
  384. if (let ==  "10111010") {letasc = letasc + 'º'}
  385. if (let ==  "10111011") {letasc = letasc + '»'}
  386. if (let ==  "10111100") {letasc = letasc + '¼'}
  387. if (let ==  "10111101") {letasc = letasc + '½'}
  388. if (let ==  "10111110") {letasc = letasc + '¾'}
  389. if (let ==  "10111111") {letasc = letasc + '¿'}
  390. if (let ==  "11000000") {letasc = letasc + 'À'}
  391. if (let ==  "11000001") {letasc = letasc + 'Á'}
  392. if (let ==  "11000010") {letasc = letasc + ''}
  393. if (let ==  "11000011") {letasc = letasc + 'Ã'}
  394. if (let ==  "11000100") {letasc = letasc + 'Ä'}
  395. if (let ==  "11000101") {letasc = letasc + 'Å'}
  396. if (let ==  "11000110") {letasc = letasc + 'Æ'}
  397. if (let ==  "11000111") {letasc = letasc + 'Ç'}
  398. if (let ==  "11001000") {letasc = letasc + 'È'}
  399. if (let ==  "11001001") {letasc = letasc + 'É'}
  400. if (let ==  "11001010") {letasc = letasc + 'Ê'}
  401. if (let ==  "11001011") {letasc = letasc + 'Ë'}
  402. if (let ==  "11001100") {letasc = letasc + 'Ì'}
  403. if (let ==  "11001101") {letasc = letasc + 'Í'}
  404. if (let ==  "11001110") {letasc = letasc + 'Î'}
  405. if (let ==  "11001111") {letasc = letasc + 'Ï'}
  406. if (let ==  "11010000") {letasc = letasc + 'Ð'}
  407. if (let ==  "11010001") {letasc = letasc + 'Ñ'}
  408. if (let ==  "11010010") {letasc = letasc + 'Ò'}
  409. if (let ==  "11010011") {letasc = letasc + 'Ó'}
  410. if (let ==  "11010100") {letasc = letasc + 'Ô'}
  411. if (let ==  "11010101") {letasc = letasc + 'Õ'}
  412. if (let ==  "11010110") {letasc = letasc + 'Ö'}
  413. if (let ==  "11010111") {letasc = letasc + '×'}
  414. if (let ==  "11011000") {letasc = letasc + 'Ø'}
  415. if (let ==  "11011001") {letasc = letasc + 'Ù'}
  416. if (let ==  "11011010") {letasc = letasc + 'Ú'}
  417. if (let ==  "11011011") {letasc = letasc + 'Û'}
  418. if (let ==  "11011100") {letasc = letasc + 'Ü'}
  419. if (let ==  "11011101") {letasc = letasc + 'Ý'}
  420. if (let ==  "11011110") {letasc = letasc + 'Þ'}
  421. if (let ==  "11011111") {letasc = letasc + 'ß'}
  422. if (let ==  "11100000") {letasc = letasc + 'à'}
  423. if (let ==  "11100001") {letasc = letasc + 'á'}
  424. if (let ==  "11100010") {letasc = letasc + ''}
  425. if (let ==  "11100011") {letasc = letasc + 'ã'}
  426. if (let ==  "11100100") {letasc = letasc + 'ä'}
  427. if (let ==  "11100101") {letasc = letasc + 'å'}
  428. if (let ==  "11100110") {letasc = letasc + 'æ'}
  429. if (let ==  "11100111") {letasc = letasc + 'ç'}
  430. if (let ==  "11101000") {letasc = letasc + 'è'}
  431. if (let ==  "11101001") {letasc = letasc + 'é'}
  432. if (let ==  "11101010") {letasc = letasc + 'ê'}
  433. if (let ==  "11101011") {letasc = letasc + 'ë'}
  434. if (let ==  "11101100") {letasc = letasc + 'ì'}
  435. if (let ==  "11101101") {letasc = letasc + 'í'}
  436. if (let ==  "11101110") {letasc = letasc + 'î'}
  437. if (let ==  "11101111") {letasc = letasc + 'ï'}
  438. if (let ==  "11110000") {letasc = letasc + 'ð'}
  439. if (let ==  "11110001") {letasc = letasc + 'ñ'}
  440. if (let ==  "11110010") {letasc = letasc + 'ò'}
  441. if (let ==  "11110011") {letasc = letasc + 'ó'}
  442. if (let ==  "11110100") {letasc = letasc + 'ô'}
  443. if (let ==  "11110101") {letasc = letasc + 'õ'}
  444. if (let ==  "11110110") {letasc = letasc + 'ö'}
  445. if (let ==  "11110111") {letasc = letasc + '÷'}
  446. if (let ==  "11111000") {letasc = letasc + 'ø'}
  447. if (let ==  "11111001") {letasc = letasc + 'ù'}
  448. if (let ==  "11111010") {letasc = letasc + 'ú'}
  449. if (let ==  "11111011") {letasc = letasc + 'û'}
  450. if (let ==  "11111100") {letasc = letasc + 'û'}
  451. if (let ==  "11111101") {letasc = letasc + 'ý'}
  452. if (let ==  "11111110") {letasc = letasc + 'þ'}
  453. if (let ==  "11111111") {letasc = letasc + 'ÿ'}
  454. if (letasc == "") {
  455. alert ("not found")
  456. break;
  457. }
  458. j=j+8
  459. }
  460. ascii.innerHTML = letasc
  461. return false;
  462. }
  463. </script>
  464. E-mail any comments to <a href="mailto:theskull@theskull.com?SUBJECT=Ascii--Binary Converter"><strong>THe SKuLL!!</strong></a><br><br>
  465. << <a href="/">http://www.theskull.com</a> >><br><br>
  466. <strong><font color="#FF0000">NOTE:</font></strong><br>
  467. Not all characters are supported.<br>
  468. However, I have updated the list.<br>
  469. <a href="ascii-binary-list.html" target="_blank">A list of characters is also availabe here.</a><br>
  470. <strong><font color="#FF0000">Updated: Dec 4, 2002</font></strong><br>
  471.  
  472. <form name="asc2bin">
  473. <strong>Convert to Binary</strong><br>
  474. Enter Text: <input type="Text" name="text" size="92"><br>
  475. Separate with: <input type="Text" name="separater" maxlength="1" size="1"> (optional)<br>
  476. <input type="Submit" value="Convert" onclick="dobin(document.asc2bin.text.value,document.asc2bin.separater.value);return false"><br>
  477. </form><div name="binary" id="binary">Binary Conversion will show here.</div><br><br>
  478. <form name="bin2asc">
  479. <strong>Convert to Ascii</strong><br>
  480. Enter Binary: <input type="Text" name="text" size="90"><br>
  481. <input type="Submit" value="Convert" onclick="doasc(document.bin2asc.text.value);return false"><br>
  482. </form>
  483. <div name="ascii" id="ascii">ASCII Conversion will show here.</div><br><br>
  484. <table align="center"><tr><td align="center" class="ts3"><strong><font color="#FF0000">010000100111100101110100011001010010000001001101011001010010000100100001</font></strong><br><img src="/iremember.gif" alt="I Remember Sep 11, 2001" width="203" height="40" border="0"><br>© 2002 G. Marshall Brown<br>
  485. Since Apr 29, 2002<br>
  486. <img src="digits/1.gif" align="absmiddle">
  487. </td></tr></table></body>
  488. </html>
  489.  





Título: Re: como hacer traductor a binario.
Publicado por: Shell Root en 1 Abril 2012, 22:27 pm
Código
  1. string decbin ( int $number )
:http://php.net/manual/es/function.decbin.php


Título: Re: como hacer traductor a binario.
Publicado por: Puntoinfinito en 1 Abril 2012, 22:41 pm
Hola, tengo que hacer un proyecto para tecnología y me gustaria hacer una pagina que sea un traductor de texto a binario y viceversa y subirlo a servidor gratuito, pero no se como hacerlo, que hago?
javascript, php


Título: Re: como hacer traductor a binario.
Publicado por: Diaf96 en 1 Abril 2012, 23:09 pm
Te has equivocado de post o va en serio? Ni la frase en si gramaticalmente tiene sentido.
Si sabes programar en un lenguaje web, ya sea PHP, javascript, etc. esto te ira muy bien: http://www.prepressure.com/library/technology/ascii_binary_hex

Lo que tienes que hacer es básicamente recorrer todo el string (cadena de texto) y segun la letra que encuentres, lo traduzca a una cifra o otra. Recuerda que el ASCII es una combinacion de 8 bits, lo que es lo mismo a un byte. Por lo tanto, 2^8, que son 256 combinaciones, el ASCII.

EDITO: He copiado el codigo fuente directamente de una pagina. Fijate en los condicionales y en el javascript. Examinalo y modificalo a tu medida. Pag. original: http://www.theskull.com/javascript/ascii-binary.html

Código
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2.  
  3. <html>
  4. <head>
  5. <title>Convert Binary to ASCII or ASCII to Binary</title>
  6. <style type="text/css">
  7. BODY {font:12px Arial;}
  8. a {text-decoration: none}
  9. TD.ts {font:24px Arial;font-weight:bold;text-align:center;}
  10. TD.ts1 {font:12px Arial;text-align:center;background-color:silver;}
  11. TD.ts2 {font:10px Arial;text-align:left;vertical-align:top;background-color:white;}
  12. TD.ts3 {font:10px Arial;text-align:center;vertical-align:top;background-color:white;}
  13. </style>
  14. </head>
  15.  
  16. <body text="black" link="blue" vlink="blue" alink="red">
  17. <script language="JavaScript1.2">
  18. // Conversion from Binary to ASCII or ASCII to Binary
  19. // Created by G. Marshall Brown
  20. // Copyright 2002 G. Marshall Brown
  21. // version 1.0 -- created 4/29/02
  22. // version 1.1 -- modified 12/04/02 Added many characters that weren't in version 1.0.
  23. // version XX -- modified --/--/--
  24. // All rights reserved, no modification without prior consent from creator.
  25. // Usage is free if Copyright statement remains intact.
  26. function dobin(text,sepa) {
  27. var letbin = ""
  28. for (i=0; i<text.length;i++) {
  29.  
  30. let = text.substr(i,1);
  31. if (i>0) {
  32. var sep = sepa;
  33. if (i % 10 == 0) {
  34. letbin=letbin+'<BR>'
  35. }
  36. }
  37. else {
  38. var sep = "";
  39. }
  40.  
  41. //Ascii -- Binary Code
  42. if (let ==  "A") {letbin = letbin + sep + '01000001'}
  43. if (let ==  "B") {letbin = letbin + sep + '01000010'}
  44. if (let ==  "C") {letbin = letbin + sep + '01000011'}
  45. if (let ==  "D") {letbin = letbin + sep + '01000100'}
  46. if (let ==  "E") {letbin = letbin + sep + '01000101'}
  47. if (let ==  "F") {letbin = letbin + sep + '01000110'}
  48. if (let ==  "G") {letbin = letbin + sep + '01000111'}
  49. if (let ==  "H") {letbin = letbin + sep + '01001000'}
  50. if (let ==  "I") {letbin = letbin + sep + '01001001'}
  51. if (let ==  "J") {letbin = letbin + sep + '01001010'}
  52. if (let ==  "K") {letbin = letbin + sep + '01001011'}
  53. if (let ==  "L") {letbin = letbin + sep + '01001100'}
  54. if (let ==  "M") {letbin = letbin + sep + '01001101'}
  55. if (let ==  "N") {letbin = letbin + sep + '01001110'}
  56. if (let ==  "O") {letbin = letbin + sep + '01001111'}
  57. if (let ==  "P") {letbin = letbin + sep + '01010000'}
  58. if (let ==  "Q") {letbin = letbin + sep + '01010001'}
  59. if (let ==  "R") {letbin = letbin + sep + '01010010'}
  60. if (let ==  "S") {letbin = letbin + sep + '01010011'}
  61. if (let ==  "T") {letbin = letbin + sep + '01010100'}
  62. if (let ==  "U") {letbin = letbin + sep + '01010101'}
  63. if (let ==  "V") {letbin = letbin + sep + '01010110'}
  64. if (let ==  "W") {letbin = letbin + sep + '01010111'}
  65. if (let ==  "X") {letbin = letbin + sep + '01011000'}
  66. if (let ==  "Y") {letbin = letbin + sep + '01011001'}
  67. if (let ==  "Z") {letbin = letbin + sep + '01011010'}
  68. if (let ==  "a") {letbin = letbin + sep + '01100001'}
  69. if (let ==  "b") {letbin = letbin + sep + '01100010'}
  70. if (let ==  "c") {letbin = letbin + sep + '01100011'}
  71. if (let ==  "d") {letbin = letbin + sep + '01100100'}
  72. if (let ==  "e") {letbin = letbin + sep + '01100101'}
  73. if (let ==  "f") {letbin = letbin + sep + '01100110'}
  74. if (let ==  "g") {letbin = letbin + sep + '01100111'}
  75. if (let ==  "h") {letbin = letbin + sep + '01101000'}
  76. if (let ==  "i") {letbin = letbin + sep + '01101001'}
  77. if (let ==  "j") {letbin = letbin + sep + '01101010'}
  78. if (let ==  "k") {letbin = letbin + sep + '01101011'}
  79. if (let ==  "l") {letbin = letbin + sep + '01101100'}
  80. if (let ==  "m") {letbin = letbin + sep + '01101101'}
  81. if (let ==  "n") {letbin = letbin + sep + '01101110'}
  82. if (let ==  "o") {letbin = letbin + sep + '01101111'}
  83. if (let ==  "p") {letbin = letbin + sep + '01110000'}
  84. if (let ==  "q") {letbin = letbin + sep + '01110001'}
  85. if (let ==  "r") {letbin = letbin + sep + '01110010'}
  86. if (let ==  "s") {letbin = letbin + sep + '01110011'}
  87. if (let ==  "t") {letbin = letbin + sep + '01110100'}
  88. if (let ==  "u") {letbin = letbin + sep + '01110101'}
  89. if (let ==  "v") {letbin = letbin + sep + '01110110'}
  90. if (let ==  "w") {letbin = letbin + sep + '01110111'}
  91. if (let ==  "x") {letbin = letbin + sep + '01111000'}
  92. if (let ==  "y") {letbin = letbin + sep + '01111001'}
  93. if (let ==  "z") {letbin = letbin + sep + '01111010'}
  94. if (let ==  " ") {letbin = letbin + sep + '00100000'}
  95.  
  96. //Numbers:
  97. if (let ==  "0") {letbin = letbin + sep + '00110000'}
  98. if (let ==  "1") {letbin = letbin + sep + '00110001'}
  99. if (let ==  "2") {letbin = letbin + sep + '00110010'}
  100. if (let ==  "3") {letbin = letbin + sep + '00110011'}
  101. if (let ==  "4") {letbin = letbin + sep + '00110100'}
  102. if (let ==  "5") {letbin = letbin + sep + '00110101'}
  103. if (let ==  "6") {letbin = letbin + sep + '00110110'}
  104. if (let ==  "7") {letbin = letbin + sep + '00110111'}
  105. if (let ==  "8") {letbin = letbin + sep + '00111000'}
  106. if (let ==  "9") {letbin = letbin + sep + '00111001'}
  107.  
  108. //Special Characters:
  109. if (let ==  "!") {letbin = letbin + sep + '00100001'}
  110. if (let ==  "\"") {letbin = letbin + sep + '00100010'}
  111. if (let ==  "#") {letbin = letbin + sep + '00100011'}
  112. if (let ==  "$") {letbin = letbin + sep + '00100100'}
  113. if (let ==  "%") {letbin = letbin + sep + '00100101'}
  114. if (let ==  "&") {letbin = letbin + sep + '00100110'}
  115. if (let ==  "'") {letbin = letbin + sep + '00100111'}
  116. if (let ==  "(") {letbin = letbin + sep + '00101000'}
  117. if (let ==  ")") {letbin = letbin + sep + '00101001'}
  118. if (let ==  "*") {letbin = letbin + sep + '00101010'}
  119. if (let ==  "+") {letbin = letbin + sep + '00101011'}
  120. if (let ==  ",") {letbin = letbin + sep + '00101100'}
  121. if (let ==  "-") {letbin = letbin + sep + '00101101'}
  122. if (let ==  ".") {letbin = letbin + sep + '00101110'}
  123. if (let ==  "/") {letbin = letbin + sep + '00101111'}
  124. if (let ==  ":") {letbin = letbin + sep + '00111010'}
  125. if (let ==  ";") {letbin = letbin + sep + '00111011'}
  126. if (let ==  "<") {letbin = letbin + sep + '00111100'}
  127. if (let ==  "=") {letbin = letbin + sep + '00111101'}
  128. if (let ==  ">") {letbin = letbin + sep + '00111110'}
  129. if (let ==  "?") {letbin = letbin + sep + '00111111'}
  130. if (let ==  "@") {letbin = letbin + sep + '01000000'}
  131. if (let ==  "[") {letbin = letbin + sep + '01011011'}
  132. if (let ==  "\\") {letbin = letbin + sep + '01011100'}
  133. if (let ==  "]") {letbin = letbin + sep + '01011101'}
  134. if (let ==  "^") {letbin = letbin + sep + '01011110'}
  135. if (let ==  "_") {letbin = letbin + sep + '01011111'}
  136. if (let ==  "`") {letbin = letbin + sep + '01100000'}
  137. if (let ==  "{") {letbin = letbin + sep + '01111011'}
  138. if (let ==  "|") {letbin = letbin + sep + '01111100'}
  139. if (let ==  "}") {letbin = letbin + sep + '01111101'}
  140. if (let ==  "~") {letbin = letbin + sep + '01111110'}
  141. if (let ==  "€") {letbin = letbin + sep + '10000000'}
  142. if (let ==  "¡") {letbin = letbin + sep + '10100001'}
  143. if (let ==  "¢") {letbin = letbin + sep + '10100010'}
  144. if (let ==  "£") {letbin = letbin + sep + '10100011'}
  145. if (let ==  "¤") {letbin = letbin + sep + '10100100'}
  146. if (let ==  "¥") {letbin = letbin + sep + '10100101'}
  147. if (let ==  "¦") {letbin = letbin + sep + '10100110'}
  148. if (let ==  "§") {letbin = letbin + sep + '10100111'}
  149. if (let ==  "¨") {letbin = letbin + sep + '10100111'}
  150. if (let ==  "©") {letbin = letbin + sep + '10101001'}
  151. if (let ==  "ª") {letbin = letbin + sep + '10101010'}
  152. if (let ==  "«") {letbin = letbin + sep + '10101011'}
  153. if (let ==  "¬") {letbin = letbin + sep + '10101100'}
  154. if (let ==  "­") {letbin = letbin + sep + '10101101'}
  155. if (let ==  "®") {letbin = letbin + sep + '10101110'}
  156. if (let ==  "¯") {letbin = letbin + sep + '10101111'}
  157. if (let ==  "°") {letbin = letbin + sep + '10110000'}
  158. if (let ==  "±") {letbin = letbin + sep + '10110001'}
  159. if (let ==  "²") {letbin = letbin + sep + '10110010'}
  160. if (let ==  "³") {letbin = letbin + sep + '10110011'}
  161. if (let ==  "´") {letbin = letbin + sep + '10110100'}
  162. if (let ==  "µ") {letbin = letbin + sep + '10110101'}
  163. if (let ==  "¶") {letbin = letbin + sep + '10110110'}
  164. if (let ==  "·") {letbin = letbin + sep + '10110111'}
  165. if (let ==  "¸") {letbin = letbin + sep + '10111000'}
  166. if (let ==  "¹") {letbin = letbin + sep + '10111001'}
  167. if (let ==  "º") {letbin = letbin + sep + '10111010'}
  168. if (let ==  "»") {letbin = letbin + sep + '10111011'}
  169. if (let ==  "¼") {letbin = letbin + sep + '10111100'}
  170. if (let ==  "½") {letbin = letbin + sep + '10111101'}
  171. if (let ==  "¾") {letbin = letbin + sep + '10111110'}
  172. if (let ==  "¿") {letbin = letbin + sep + '10111111'}
  173. if (let ==  "À") {letbin = letbin + sep + '11000000'}
  174. if (let ==  "Á") {letbin = letbin + sep + '11000001'}
  175. if (let ==  "") {letbin = letbin + sep + '11000010'}
  176. if (let ==  "Ã") {letbin = letbin + sep + '11000011'}
  177. if (let ==  "Ä") {letbin = letbin + sep + '11000100'}
  178. if (let ==  "Å") {letbin = letbin + sep + '11000101'}
  179. if (let ==  "Æ") {letbin = letbin + sep + '11000110'}
  180. if (let ==  "Ç") {letbin = letbin + sep + '11000111'}
  181. if (let ==  "È") {letbin = letbin + sep + '11001000'}
  182. if (let ==  "É") {letbin = letbin + sep + '11001001'}
  183. if (let ==  "Ê") {letbin = letbin + sep + '11001010'}
  184. if (let ==  "Ë") {letbin = letbin + sep + '11001011'}
  185. if (let ==  "Ì") {letbin = letbin + sep + '11001100'}
  186. if (let ==  "Í") {letbin = letbin + sep + '11001101'}
  187. if (let ==  "Î") {letbin = letbin + sep + '11001110'}
  188. if (let ==  "Ï") {letbin = letbin + sep + '11001111'}
  189. if (let ==  "Ð") {letbin = letbin + sep + '11010000'}
  190. if (let ==  "Ñ") {letbin = letbin + sep + '11010001'}
  191. if (let ==  "Ò") {letbin = letbin + sep + '11010010'}
  192. if (let ==  "Ó") {letbin = letbin + sep + '11010011'}
  193. if (let ==  "Ô") {letbin = letbin + sep + '11010100'}
  194. if (let ==  "Õ") {letbin = letbin + sep + '11010101'}
  195. if (let ==  "Ö") {letbin = letbin + sep + '11010110'}
  196. if (let ==  "×") {letbin = letbin + sep + '11010111'}
  197. if (let ==  "Ø") {letbin = letbin + sep + '11011000'}
  198. if (let ==  "Ù") {letbin = letbin + sep + '11011001'}
  199. if (let ==  "Ú") {letbin = letbin + sep + '11011010'}
  200. if (let ==  "Û") {letbin = letbin + sep + '11011011'}
  201. if (let ==  "Ü") {letbin = letbin + sep + '11011100'}
  202. if (let ==  "Ý") {letbin = letbin + sep + '11011101'}
  203. if (let ==  "Þ") {letbin = letbin + sep + '11011110'}
  204. if (let ==  "ß") {letbin = letbin + sep + '11011111'}
  205. if (let ==  "à") {letbin = letbin + sep + '11100000'}
  206. if (let ==  "á") {letbin = letbin + sep + '11100001'}
  207. if (let ==  "") {letbin = letbin + sep + '11100010'}
  208. if (let ==  "ã") {letbin = letbin + sep + '11100011'}
  209. if (let ==  "ä") {letbin = letbin + sep + '11100100'}
  210. if (let ==  "å") {letbin = letbin + sep + '11100101'}
  211. if (let ==  "æ") {letbin = letbin + sep + '11100110'}
  212. if (let ==  "ç") {letbin = letbin + sep + '11100111'}
  213. if (let ==  "è") {letbin = letbin + sep + '11101000'}
  214. if (let ==  "é") {letbin = letbin + sep + '11101001'}
  215. if (let ==  "ê") {letbin = letbin + sep + '11101010'}
  216. if (let ==  "ë") {letbin = letbin + sep + '11101011'}
  217. if (let ==  "ì") {letbin = letbin + sep + '11101100'}
  218. if (let ==  "í") {letbin = letbin + sep + '11101101'}
  219. if (let ==  "î") {letbin = letbin + sep + '11101110'}
  220. if (let ==  "ï") {letbin = letbin + sep + '11101111'}
  221. if (let ==  "ð") {letbin = letbin + sep + '11110000'}
  222. if (let ==  "ñ") {letbin = letbin + sep + '11110001'}
  223. if (let ==  "ò") {letbin = letbin + sep + '11110010'}
  224. if (let ==  "ó") {letbin = letbin + sep + '11110011'}
  225. if (let ==  "ô") {letbin = letbin + sep + '11110100'}
  226. if (let ==  "õ") {letbin = letbin + sep + '11110101'}
  227. if (let ==  "ö") {letbin = letbin + sep + '11110110'}
  228. if (let ==  "÷") {letbin = letbin + sep + '11110111'}
  229. if (let ==  "ø") {letbin = letbin + sep + '11111000'}
  230. if (let ==  "ù") {letbin = letbin + sep + '11111001'}
  231. if (let ==  "ú") {letbin = letbin + sep + '11111010'}
  232. if (let ==  "û") {letbin = letbin + sep + '11111011'}
  233. if (let ==  "û") {letbin = letbin + sep + '11111100'}
  234. if (let ==  "ý") {letbin = letbin + sep + '11111101'}
  235. if (let ==  "þ") {letbin = letbin + sep + '11111110'}
  236. if (let ==  "ÿ") {letbin = letbin + sep + '11111111'}
  237.  
  238. }
  239. binary.innerHTML = letbin
  240. return false;
  241. }
  242.  
  243. function doasc(text) {
  244.  
  245. if (text.length % 8 != 0) {
  246. alert (text + " is not an even binary.\n\nYou may have missed a digit or maybe added an additional digit/character.\n\nSeparaters are NOT required here.")
  247. return false;
  248. last;
  249. }
  250. var letasc = ""
  251. lettot = text.length / 8
  252. j=0
  253. for (i=0; i<lettot;i++) {
  254.  
  255. let = text.substr(j,8);
  256.  
  257.  
  258.  
  259. if (let ==  "01000001") {letasc = letasc + 'A'}
  260. if (let ==  "01000010") {letasc = letasc + 'B'}
  261. if (let ==  "01000011") {letasc = letasc + 'C'}
  262. if (let ==  "01000100") {letasc = letasc + 'D'}
  263. if (let ==  "01000101") {letasc = letasc + 'E'}
  264. if (let ==  "01000110") {letasc = letasc + 'F'}
  265. if (let ==  "01000111") {letasc = letasc + 'G'}
  266. if (let ==  "01001000") {letasc = letasc + 'H'}
  267. if (let ==  "01001001") {letasc = letasc + 'I'}
  268. if (let ==  "01001010") {letasc = letasc + 'J'}
  269. if (let ==  "01001011") {letasc = letasc + 'K'}
  270. if (let ==  "01001100") {letasc = letasc + 'L'}
  271. if (let ==  "01001101") {letasc = letasc + 'M'}
  272. if (let ==  "01001110") {letasc = letasc + 'N'}
  273. if (let ==  "01001111") {letasc = letasc + 'O'}
  274. if (let ==  "01010000") {letasc = letasc + 'P'}
  275. if (let ==  "01010001") {letasc = letasc + 'Q'}
  276. if (let ==  "01010010") {letasc = letasc + 'R'}
  277. if (let ==  "01010011") {letasc = letasc + 'S'}
  278. if (let ==  "01010100") {letasc = letasc + 'T'}
  279. if (let ==  "01010101") {letasc = letasc + 'U'}
  280. if (let ==  "01010110") {letasc = letasc + 'V'}
  281. if (let ==  "01010111") {letasc = letasc + 'W'}
  282. if (let ==  "01011000") {letasc = letasc + 'X'}
  283. if (let ==  "01011001") {letasc = letasc + 'Y'}
  284. if (let ==  "01011010") {letasc = letasc + 'Z'}
  285. if (let ==  "01100001") {letasc = letasc + 'a'}
  286. if (let ==  "01100010") {letasc = letasc + 'b'}
  287. if (let ==  "01100011") {letasc = letasc + 'c'}
  288. if (let ==  "01100100") {letasc = letasc + 'd'}
  289. if (let ==  "01100101") {letasc = letasc + 'e'}
  290. if (let ==  "01100110") {letasc = letasc + 'f'}
  291. if (let ==  "01100111") {letasc = letasc + 'g'}
  292. if (let ==  "01101000") {letasc = letasc + 'h'}
  293. if (let ==  "01101001") {letasc = letasc + 'i'}
  294. if (let ==  "01101010") {letasc = letasc + 'j'}
  295. if (let ==  "01101011") {letasc = letasc + 'k'}
  296. if (let ==  "01101100") {letasc = letasc + 'l'}
  297. if (let ==  "01101101") {letasc = letasc + 'm'}
  298. if (let ==  "01101110") {letasc = letasc + 'n'}
  299. if (let ==  "01101111") {letasc = letasc + 'o'}
  300. if (let ==  "01110000") {letasc = letasc + 'p'}
  301. if (let ==  "01110001") {letasc = letasc + 'q'}
  302. if (let ==  "01110010") {letasc = letasc + 'r'}
  303. if (let ==  "01110011") {letasc = letasc + 's'}
  304. if (let ==  "01110100") {letasc = letasc + 't'}
  305. if (let ==  "01110101") {letasc = letasc + 'u'}
  306. if (let ==  "01110110") {letasc = letasc + 'v'}
  307. if (let ==  "01110111") {letasc = letasc + 'w'}
  308. if (let ==  "01111000") {letasc = letasc + 'x'}
  309. if (let ==  "01111001") {letasc = letasc + 'y'}
  310. if (let ==  "01111010") {letasc = letasc + 'z'}
  311. if (let ==  "00100000") {letasc = letasc + ' '}
  312.  
  313. //Numbers:
  314. if (let ==  "00110000") {letasc = letasc + '0'}
  315. if (let ==  "00110001") {letasc = letasc + '1'}
  316. if (let ==  "00110010") {letasc = letasc + '2'}
  317. if (let ==  "00110011") {letasc = letasc + '3'}
  318. if (let ==  "00110100") {letasc = letasc + '4'}
  319. if (let ==  "00110101") {letasc = letasc + '5'}
  320. if (let ==  "00110110") {letasc = letasc + '6'}
  321. if (let ==  "00110111") {letasc = letasc + '7'}
  322. if (let ==  "00111000") {letasc = letasc + '8'}
  323. if (let ==  "00111001") {letasc = letasc + '9'}
  324.  
  325. //Special Characters:
  326. if (let ==  "00100001") {letasc = letasc + '!'}
  327. if (let ==  "00100010") {letasc = letasc + '\"'}
  328. if (let ==  "00100011") {letasc = letasc + '#'}
  329. if (let ==  "00100100") {letasc = letasc + '$'}
  330. if (let ==  "00100101") {letasc = letasc + '%'}
  331. if (let ==  "00100110") {letasc = letasc + '&'}
  332. if (let ==  "00100111") {letasc = letasc + '\''}
  333. if (let ==  "00101000") {letasc = letasc + '('}
  334. if (let ==  "00101001") {letasc = letasc + ')'}
  335. if (let ==  "00101010") {letasc = letasc + '*'}
  336. if (let ==  "00101011") {letasc = letasc + '+'}
  337. if (let ==  "00101100") {letasc = letasc + ','}
  338. if (let ==  "00101101") {letasc = letasc + '-'}
  339. if (let ==  "00101110") {letasc = letasc + '.'}
  340. if (let ==  "00101111") {letasc = letasc + '/'}
  341. if (let ==  "00111010") {letasc = letasc + ':'}
  342. if (let ==  "00111011") {letasc = letasc + ';'}
  343. if (let ==  "00111100") {letasc = letasc + '<'}
  344. if (let ==  "00111101") {letasc = letasc + '='}
  345. if (let ==  "00111110") {letasc = letasc + '>'}
  346. if (let ==  "00111111") {letasc = letasc + '?'}
  347. if (let ==  "01000000") {letasc = letasc + '@'}
  348. if (let ==  "01011011") {letasc = letasc + '['}
  349. if (let ==  "01011100") {letasc = letasc + '\\'}
  350. if (let ==  "01011101") {letasc = letasc + ']'}
  351. if (let ==  "01011110") {letasc = letasc + '^'}
  352. if (let ==  "01011111") {letasc = letasc + '_'}
  353. if (let ==  "01100000") {letasc = letasc + '`'}
  354. if (let ==  "01111011") {letasc = letasc + '{'}
  355. if (let ==  "01111100") {letasc = letasc + '|'}
  356. if (let ==  "01111101") {letasc = letasc + '}'}
  357. if (let ==  "01111110") {letasc = letasc + '~'}
  358. if (let ==  "10000000") {letasc = letasc + '€'}
  359. if (let ==  "10100001") {letasc = letasc + '¡'}
  360. if (let ==  "10100010") {letasc = letasc + '¢'}
  361. if (let ==  "10100011") {letasc = letasc + '£'}
  362. if (let ==  "10100100") {letasc = letasc + '¤'}
  363. if (let ==  "10100101") {letasc = letasc + '¥'}
  364. if (let ==  "10100110") {letasc = letasc + '¦'}
  365. if (let ==  "10100111") {letasc = letasc + '§'}
  366. if (let ==  "10100111") {letasc = letasc + '¨'}
  367. if (let ==  "10101001") {letasc = letasc + '©'}
  368. if (let ==  "10101010") {letasc = letasc + 'ª'}
  369. if (let ==  "10101011") {letasc = letasc + '«'}
  370. if (let ==  "10101100") {letasc = letasc + '¬'}
  371. if (let ==  "10101101") {letasc = letasc + '­'}
  372. if (let ==  "10101110") {letasc = letasc + '®'}
  373. if (let ==  "10101111") {letasc = letasc + '¯'}
  374. if (let ==  "10110000") {letasc = letasc + '°'}
  375. if (let ==  "10110001") {letasc = letasc + '±'}
  376. if (let ==  "10110010") {letasc = letasc + '²'}
  377. if (let ==  "10110011") {letasc = letasc + '³'}
  378. if (let ==  "10110100") {letasc = letasc + '´'}
  379. if (let ==  "10110101") {letasc = letasc + 'µ'}
  380. if (let ==  "10110110") {letasc = letasc + '¶'}
  381. if (let ==  "10110111") {letasc = letasc + '·'}
  382. if (let ==  "10111000") {letasc = letasc + '¸'}
  383. if (let ==  "10111001") {letasc = letasc + '¹'}
  384. if (let ==  "10111010") {letasc = letasc + 'º'}
  385. if (let ==  "10111011") {letasc = letasc + '»'}
  386. if (let ==  "10111100") {letasc = letasc + '¼'}
  387. if (let ==  "10111101") {letasc = letasc + '½'}
  388. if (let ==  "10111110") {letasc = letasc + '¾'}
  389. if (let ==  "10111111") {letasc = letasc + '¿'}
  390. if (let ==  "11000000") {letasc = letasc + 'À'}
  391. if (let ==  "11000001") {letasc = letasc + 'Á'}
  392. if (let ==  "11000010") {letasc = letasc + ''}
  393. if (let ==  "11000011") {letasc = letasc + 'Ã'}
  394. if (let ==  "11000100") {letasc = letasc + 'Ä'}
  395. if (let ==  "11000101") {letasc = letasc + 'Å'}
  396. if (let ==  "11000110") {letasc = letasc + 'Æ'}
  397. if (let ==  "11000111") {letasc = letasc + 'Ç'}
  398. if (let ==  "11001000") {letasc = letasc + 'È'}
  399. if (let ==  "11001001") {letasc = letasc + 'É'}
  400. if (let ==  "11001010") {letasc = letasc + 'Ê'}
  401. if (let ==  "11001011") {letasc = letasc + 'Ë'}
  402. if (let ==  "11001100") {letasc = letasc + 'Ì'}
  403. if (let ==  "11001101") {letasc = letasc + 'Í'}
  404. if (let ==  "11001110") {letasc = letasc + 'Î'}
  405. if (let ==  "11001111") {letasc = letasc + 'Ï'}
  406. if (let ==  "11010000") {letasc = letasc + 'Ð'}
  407. if (let ==  "11010001") {letasc = letasc + 'Ñ'}
  408. if (let ==  "11010010") {letasc = letasc + 'Ò'}
  409. if (let ==  "11010011") {letasc = letasc + 'Ó'}
  410. if (let ==  "11010100") {letasc = letasc + 'Ô'}
  411. if (let ==  "11010101") {letasc = letasc + 'Õ'}
  412. if (let ==  "11010110") {letasc = letasc + 'Ö'}
  413. if (let ==  "11010111") {letasc = letasc + '×'}
  414. if (let ==  "11011000") {letasc = letasc + 'Ø'}
  415. if (let ==  "11011001") {letasc = letasc + 'Ù'}
  416. if (let ==  "11011010") {letasc = letasc + 'Ú'}
  417. if (let ==  "11011011") {letasc = letasc + 'Û'}
  418. if (let ==  "11011100") {letasc = letasc + 'Ü'}
  419. if (let ==  "11011101") {letasc = letasc + 'Ý'}
  420. if (let ==  "11011110") {letasc = letasc + 'Þ'}
  421. if (let ==  "11011111") {letasc = letasc + 'ß'}
  422. if (let ==  "11100000") {letasc = letasc + 'à'}
  423. if (let ==  "11100001") {letasc = letasc + 'á'}
  424. if (let ==  "11100010") {letasc = letasc + ''}
  425. if (let ==  "11100011") {letasc = letasc + 'ã'}
  426. if (let ==  "11100100") {letasc = letasc + 'ä'}
  427. if (let ==  "11100101") {letasc = letasc + 'å'}
  428. if (let ==  "11100110") {letasc = letasc + 'æ'}
  429. if (let ==  "11100111") {letasc = letasc + 'ç'}
  430. if (let ==  "11101000") {letasc = letasc + 'è'}
  431. if (let ==  "11101001") {letasc = letasc + 'é'}
  432. if (let ==  "11101010") {letasc = letasc + 'ê'}
  433. if (let ==  "11101011") {letasc = letasc + 'ë'}
  434. if (let ==  "11101100") {letasc = letasc + 'ì'}
  435. if (let ==  "11101101") {letasc = letasc + 'í'}
  436. if (let ==  "11101110") {letasc = letasc + 'î'}
  437. if (let ==  "11101111") {letasc = letasc + 'ï'}
  438. if (let ==  "11110000") {letasc = letasc + 'ð'}
  439. if (let ==  "11110001") {letasc = letasc + 'ñ'}
  440. if (let ==  "11110010") {letasc = letasc + 'ò'}
  441. if (let ==  "11110011") {letasc = letasc + 'ó'}
  442. if (let ==  "11110100") {letasc = letasc + 'ô'}
  443. if (let ==  "11110101") {letasc = letasc + 'õ'}
  444. if (let ==  "11110110") {letasc = letasc + 'ö'}
  445. if (let ==  "11110111") {letasc = letasc + '÷'}
  446. if (let ==  "11111000") {letasc = letasc + 'ø'}
  447. if (let ==  "11111001") {letasc = letasc + 'ù'}
  448. if (let ==  "11111010") {letasc = letasc + 'ú'}
  449. if (let ==  "11111011") {letasc = letasc + 'û'}
  450. if (let ==  "11111100") {letasc = letasc + 'û'}
  451. if (let ==  "11111101") {letasc = letasc + 'ý'}
  452. if (let ==  "11111110") {letasc = letasc + 'þ'}
  453. if (let ==  "11111111") {letasc = letasc + 'ÿ'}
  454. if (letasc == "") {
  455. alert ("not found")
  456. break;
  457. }
  458. j=j+8
  459. }
  460. ascii.innerHTML = letasc
  461. return false;
  462. }
  463. </script>
  464. E-mail any comments to <a href="mailto:theskull@theskull.com?SUBJECT=Ascii--Binary Converter"><strong>THe SKuLL!!</strong></a><br><br>
  465. << <a href="/">http://www.theskull.com</a> >><br><br>
  466. <strong><font color="#FF0000">NOTE:</font></strong><br>
  467. Not all characters are supported.<br>
  468. However, I have updated the list.<br>
  469. <a href="ascii-binary-list.html" target="_blank">A list of characters is also availabe here.</a><br>
  470. <strong><font color="#FF0000">Updated: Dec 4, 2002</font></strong><br>
  471.  
  472. <form name="asc2bin">
  473. <strong>Convert to Binary</strong><br>
  474. Enter Text: <input type="Text" name="text" size="92"><br>
  475. Separate with: <input type="Text" name="separater" maxlength="1" size="1"> (optional)<br>
  476. <input type="Submit" value="Convert" onclick="dobin(document.asc2bin.text.value,document.asc2bin.separater.value);return false"><br>
  477. </form><div name="binary" id="binary">Binary Conversion will show here.</div><br><br>
  478. <form name="bin2asc">
  479. <strong>Convert to Ascii</strong><br>
  480. Enter Binary: <input type="Text" name="text" size="90"><br>
  481. <input type="Submit" value="Convert" onclick="doasc(document.bin2asc.text.value);return false"><br>
  482. </form>
  483. <div name="ascii" id="ascii">ASCII Conversion will show here.</div><br><br>
  484. <table align="center"><tr><td align="center" class="ts3"><strong><font color="#FF0000">010000100111100101110100011001010010000001001101011001010010000100100001</font></strong><br><img src="/iremember.gif" alt="I Remember Sep 11, 2001" width="203" height="40" border="0"><br>© 2002 G. Marshall Brown<br>
  485. Since Apr 29, 2002<br>
  486. <img src="digits/1.gif" align="absmiddle">
  487. </td></tr></table></body>
  488. </html>
  489.  




La verdad esque no tengo mucha idea, pero se que al profesor le gustara, muchas gracias, aun asi tengo una duda. Ya tengo el servidor donde lo metere, 000webhost, pero ahora como y en que formato lo subo al servidor?, estoy acostumbrado a usar el html de wordpress que te lo da ya casi hecho y no usa ni php ni javascript.


Título: Re: como hacer traductor a binario.
Publicado por: Puntoinfinito en 1 Abril 2012, 23:15 pm
Pero no lo has echo tu D:
No tendra merito...


Título: Re: como hacer traductor a binario.
Publicado por: Diaf96 en 1 Abril 2012, 23:17 pm
Pero no lo has echo tu D:
No tendra merito...
No te digo que no y esta mal apropiarse de codigos agenos, pero enserio, ahor mismo estoy mirando el codigo y observado su funcionamiento ademas de que le modificare alguna cosa.


Título: Re: como hacer traductor a binario.
Publicado por: farresito en 1 Abril 2012, 23:24 pm
Pero no lo has echo tu D:
No tendra merito...
No, si la intencion no es copiar todo el codigo, es solo copiar los if-else. Tener que hacer todos los ifs de 256 caracteres es bestial y hacer las conversiones.


Título: Re: como hacer traductor a binario.
Publicado por: Puntoinfinito en 1 Abril 2012, 23:32 pm
Ah, okok :)
Es que con estos temas soy muy noob... Soy más de multimedia y visual basic xD
Salu2


Título: Re: como hacer traductor a binario.
Publicado por: Diaf96 en 1 Abril 2012, 23:33 pm
No, si la intencion no es copiar todo el codigo, es solo copiar los if-else. Tener que hacer todos los ifs de 256 caracteres es bestial y hacer las conversiones.
Si, es lo que estoy usando, lo demas lo descarte excepto la parte en la que se pone el texto, hay alguna forma de hacerlo mas grande?, y los botones de "convert" se les puede cambiar el texto?.


Título: Re: como hacer traductor a binario.
Publicado por: farresito en 2 Abril 2012, 00:44 am
Veo que no tienes conocimientos de HTML o CSS.

Modificalo aqui, donde pone px (pixeles):

Código
  1. <style type="text/css">
  2. BODY {font:12px Arial;}
  3. a {text-decoration: none}
  4. TD.ts {font:24px Arial;font-weight:bold;text-align:center;}
  5. TD.ts1 {font:12px Arial;text-align:center;background-color:silver;}
  6. TD.ts2 {font:10px Arial;text-align:left;vertical-align:top;background-color:white;}
  7. TD.ts3 {font:10px Arial;text-align:center;vertical-align:top;background-color:white;}
  8. </style>

Y en cuanto el nombre 'convert', busca esto:
Código:
input type="Submit" value="Convert" onclick="doasc(document.bin2asc.text.value);return false"><br>

Y cambias el atributo value por el que quieras.


Título: Re: como hacer traductor a binario.
Publicado por: $Edu$ en 2 Abril 2012, 01:24 am
Ah, okok :)
Es que con estos temas soy muy noob... Soy más de multimedia y visual basic xD
Salu2

Y que haces comentando sin saber algo apenas aunquesea?


Título: Re: como hacer traductor a binario.
Publicado por: farresito en 2 Abril 2012, 04:29 am
Y que haces comentando sin saber algo apenas aunquesea?
No creo que sea apropiado enfadarse con alguien por eso. Tiene todo el derecho del mundo en comentar donde quiera. Y mas sabiendo que lo hace voluntariamente. Es verdad que podía aportar un poco mas de información, pero es lo de menos el conocimiento. Es lo que hace elHacker una comunidad única. El hecho de compartir información sin importar el nivel.


Título: Re: como hacer traductor a binario.
Publicado por: Diaf96 en 2 Abril 2012, 11:23 am
Me podeis decir servicios de hsoting gratis buenos?, principio iba a subirlo a 000webhost, pero si hay alguno mejor sera bienvenido.
En que formato o como debo subirlo al servidor?


Título: Re: como hacer traductor a binario.
Publicado por: Puntoinfinito en 2 Abril 2012, 11:37 am
Y que haces comentando sin saber algo apenas aunquesea?
Porque recuerdo haber echo por youtube un traductor desde Aptana Studio.


Título: Re: como hacer traductor a binario.
Publicado por: Diaf96 en 2 Abril 2012, 14:22 pm
Código:
<form name="bin2asc"></form><form name="bin2asc"><strong>Traduzca a texto:
</strong></form><form name="bin2asc">Introduzca en binario: <input type="Text" name="text" size="90" />

<input onclick="doasc(document.bin2asc.text.value);return false" type="Submit" value="Traducir" />

</form>
En esta parte del codigo, me gustaría que el boton de traducir estuviera seguido del la barra donde se introduce el texto en vez de abajo.
¿Como lo puedo solucionar?


Título: Re: como hacer traductor a binario.
Publicado por: javirk en 2 Abril 2012, 15:03 pm
Eso depende de la longitud que tenga el contenedor donde esté el formulario, si sólo pones eso en la web sale como tú quieres.

Un saludo


Título: Re: como hacer traductor a binario.
Publicado por: Diaf96 en 2 Abril 2012, 15:30 pm
Eso depende de la longitud que tenga el contenedor donde esté el formulario, si sólo pones eso en la web sale como tú quieres.

Un saludo

Esque lo estuve probando en wordpress y son dos, uno queda bien y el otro abajo.


Título: Re: como hacer traductor a binario.
Publicado por: engel lex en 27 Abril 2012, 08:17 am
chamos en el codigo se pasaron XD
por php se puede hacer esto,  que es mucho mas simple y rapido en vez de ese montoooooooooon de comandos

Código:
function ascii_a_binario($letra){
if(mb_detect_encoding($letra)=="UTF-8"){
$letra=utf8_decode($letra);//a ord() no le gustan los utf8 sino los iso
}
$ascii = ord($letra);//aqui se convierte en numero
$bin=decbin($ascii);//esto lo conbierte en binario
$pad=str_pad($bin,8,"0",STR_PAD_LEFT);//si le faltan 0 a la izquierda esta funcion los coloca
return $pad;
}
function binario_a_ascii($bin){
$int=bindec($bin);//esto lo conbierte en integer
$letra= chr($int);//aqui se convierte en letra
//solo dejar esta linea si tu html es utf8
$letra=utf8_encode($letra);
return $letra;
}

(claro está que esa funcion se puede colocar en usa sola linea sin mas variables  y necesitas otra que le pase letra a letra, que son 4 lineas tambien


Título: Re: como hacer traductor a binario.
Publicado por: anonimo12121 en 27 Abril 2012, 14:05 pm
Se supone que eres programador, Un programador soluciona los problemas WTF si no has creado nada no puedes solucionar el problema, Tienes que hacer tu las cosas informarte del tema e intentarlo si no te sale entonces ya pides ayuda :)


Título: Re: como hacer traductor a binario.
Publicado por: Puntoinfinito en 27 Abril 2012, 16:16 pm
Sobre lo del Hosting:
x10hosting