Recently a site was discovered for Project Offset (http://www.projectoffset.com/astormiscoming/) At the bottom of the page is the binary code: 01101011 01100101 01100101 01110000 00100000 01100111 01101111 01101001 01101110 01100111 Which translates to decimal: 107 101 101 112 32 103 111 105 110 103 Which, in ASCII, is: k e e p [:space:] g o i n g My first thought upon finding this out was how awsome it was they hid a message in binary, but my second one was "How exactly does one translate words to binary?". Are their any methods or programs out their to achieve this? I think it would be neat to write messages in binary just for kicks.
There are programs that do it for you, like here. In C, one could do: for (i=0;str;i++) printf("%08b ",str);
I don't know what compiler you are using, but that isn't standard. Code: #include <stdio.h> int main( int argc, char **argv ) { int arg; int i; int b; for( arg = 1; arg < argc; arg++ ) { for( i = 0; i < strlen( argv[ arg ] ); i++ ) { for( b = 0; b < 8; b++ ) { printf( "%c", '0' + ( ( argv[ arg ][ i ] >> ( 7 - b ) ) & 1 ) ); } printf( "\n" ); } } } smf
Anyone share my first thought? That there are far better uses for C (or Perl, or VB, or whatever) than this?
In case you need the information : words are made up of characters, characters in ASCII are represented by numbers, numbers can be translated into a base-2 (hey that's binary! ) representation. Have a look at wikipedia for that
it would depend on the convention. mobile phones for example dont use the same standards (they used 5bits per byte in messaging etc)
there was a time where i could write pages of text in binary, using my mind and a pen. There's a logic to it, but i don't remember much. I think every letters starts with 01, then the third number, 0 or 1, depends if its a Big or a small letter, 1 for big 0 for small i think. The first from the right always switch from 0 to 1 at each letter, the second (always from the right) switch at every four, but is already at the second zero at the start, the 3rd from the right switch at every 8 but already is at the second 0 too, and shit like that. It was funny in a geek way.