Writing in binary

Discussion in 'Off Topic Discussion' started by Fabrizo, Apr 22, 2007.

  1. Fabrizo

    Fabrizo Resolute Member

    Joined:
    Mar 14, 2004
    Messages:
    933
    Likes Received:
    0
    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.
     
  2. drx

    drx BLAST PROCESSING. SITE SUPPORTER 2015

    Joined:
    Jun 16, 2006
    Messages:
    509
    Likes Received:
    276
    There are programs that do it for you, like here.

    In C, one could do:

    for (i=0;str;i++) printf("%08b ",str);
     
  3. A. Snow

    A. Snow Old School Member

    Joined:
    Mar 13, 2004
    Messages:
    2,432
    Likes Received:
    10
  4. smf

    smf mamedev

    Joined:
    Apr 14, 2005
    Messages:
    1,255
    Likes Received:
    88


    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
     
    Last edited: Apr 22, 2007
  5. GaijinPunch

    GaijinPunch Lemon Party Organizer and Promoter

    Joined:
    Mar 13, 2004
    Messages:
    10,999
    Likes Received:
    75
    Anyone share my first thought? That there are far better uses for C (or Perl, or VB, or whatever) than this?
     
  6. kammedo

    kammedo and the lost N64 Hardware Docs

    Joined:
    Sep 24, 2004
    Messages:
    2,138
    Likes Received:
    12

    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! :p) representation. Have a look at wikipedia for that :p
     
  7. Barc0de

    Barc0de Mythical Member from Time Immemorial

    Joined:
    Oct 29, 2005
    Messages:
    11,205
    Likes Received:
    23
    it would depend on the convention. mobile phones for example dont use the same standards (they used 5bits per byte in messaging etc)
     
  8. cahaz

    cahaz Guardian of the Forum

    Joined:
    May 21, 2004
    Messages:
    4,586
    Likes Received:
    2
    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.
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page