binary <==> ascii
Posted 28 September 2002 - 01:24 AM
Firstly, lets rehash a little bit of basic computer background. Everyone learned in their first computer class that there are 8 bits in a byte. We also learned that there is 1 byte per character. The bits that make up that character are a combination of ZEROES and ONES. The computer interprets these 1s and 0s into a readable human language standard as defined by ANSI. This format is called ASCII. The 1s and 0s are called BINARY.
Since you have 8 BITS to define the character you want, you use a simple mathematical algorithm to figure out the values for the characters you want. You can do this in your head, but it can be time consuming. Lets start with an easy example.
the first logical binary combination is 00000000 (EIGHT ZEROES). this is the starting point and is called a "NUL" or null value. It actually literally means nothing. Think of it as opening your mouth, but nothing comes out. The next combination, would be 00000001. This is logically the next sequential number in the sequence. This is where a lot of people make their first mistake.
To be thorough, you should never drop leading ZEROES!!! Mathematically, 1=01=0001=00000001 ! Leading zeroes are ignored! NOT IN BINARY!!! It takes ALL EIGHT bits to define each byte. There is no other way to know the start and stop point of the byte other than length! Which is another thing that some people don't understand. There are NO SPACES between letters, words, or anything in binary. It is location dependant.
But lets keep the examples simple right now.
I mentioned earlier that the next sequential number in binary would be 00000001. Most people assume this to be the letter "A". I also explained that some people drop the leading ZEROES, and just think that 1=A=00000001. The next number in sequence is 00000010 (sometimes written as 10) since the binary system only uses 1 and 0. The third number in sequence is 00000011 (sometimes written as 11) and so on, and so on. They are commonly assumed to be B and C, and so on. By following this pattern, you can cover all 26 letters by only needing 5 of the 8 significant digits ending with Z as 00011010 (or 11010, dropping the leading zeroes).
This is "almost" correct.
You NEVER DROP LEADING ZEROES!!! IN BINARY, ALL DIGITS ARE SIGNIFICANT DIGITS!!! Here is why.
Since I explained that you only need 5 to define the letters, and that all 8 are needed for the BYTE makeup, that leaves 3 digits unused, right? These digits are used to further breakdown ASCII characters. These are characters like the playing card faces(00000011,00000100,00000101,00000110 ), and stuff like that. Some other non-alphanumeric characters begin with "001" such as "00100000" which is the BLANKSPACE character (much different then a NUL character).
The first three digits for the standard 26 letter english alphabet (capital letters only) begin with "010" and then the 5 digit sequence as defined above. The first three digits if the lower case numbers begin with "011".
SO, that means that the capital letter "A" in binary is...
BUT IS "01000001"
And since the length is always 8 for each BYTE/CHARACTER you know that you do not need the space or any delimeter after the first BYTE, so you go right into your next letter. Note that words are seperated naturally by including the BINARY notation for a space and not actually delimiting it with a space. BINARY is always one continuous string of characters.
Now look at the message below and decode it using this method. Don't post the answer here and ruin it for everyone, just post if you understand it.
Now, it is late, the stuff above is probably not as clear as I had hoped, but I will clean it up another time. Bedtime for Stanky!
EDIT by nick84: Not sure how people feel about others editing their posts is it “allowed”? - (hope you don’t mind SD)
Anyway I just split the long binary number you have onto two lines, because otherwise when people read the page they have to keep scrolling across and back because the 1 long continuous character string does not automatically get wrapped to a new line.
Posted 28 September 2002 - 03:42 AM
Posted 29 September 2002 - 01:39 AM
1) You started with mixed case, then stopped.
2) The delimiters that you use (%) show that you are a child of the WEB. Numbering systems do not need delimiters.
3) Binary is machine level while ascii is human level. HEX is simply a bastard child that falls in between the two.
Posted 29 September 2002 - 01:55 AM
Posted 29 September 2002 - 03:33 AM
Child of the web lol, I don’t know about that, im more a child of understanding hex, binary etc.
The delimiters that you use (%) show that you are a child of the WEB. Numbering systems do not need delimiters.
Anyway’s, its not my fault the %’s are there, the automatic conversion utitity I used ( http://www.paradigm....x/ascii2hex.htm ) put them in
Posted 29 September 2002 - 11:03 AM
You make make a numbering system with any BASE that you want. IT just so happens that BASE 16, BASE 10, Base 8, and Base 2 are the most appropriate to computer technology.
Posted 15 December 2002 - 07:02 AM
Try solving it using vi while keeping keystokes to a minimium.
It's like playing a real cool version of hangman.
Posted 15 December 2002 - 08:38 PM
1. Bust out my trusty notepad
2. I went ahead and converted the entire alphabet, not nearly as time consuming as i thought it was.
3. Then copied the string in increments of 8 and converted them
Also a very handy tool for converting/unconverting binary messages ...
#!/usr/bin/perl -w $x = 0; print "text to convert: "; chomp($x = <STDIN>); print unpack("B*","$x"); print "\n";
and to convert from binary to ascii
#!/usr/bin/perl -w $x = 0; print "text to convert: "; chomp($x = <STDIN>); print pack("B*","$x"); print "\n";I got those from http://darkbytes.net He has a few usefull perl scripts up on his website and some good themes/background images/random cool stuff. He also has a book called Underground up there in text. I havent finished it yet but its been good so far. Check it out.
BinRev is hosted by the great people at Lunarpages!