• Home
  • Flailing Wildly
  • Résumé
  • Design
  • Code
  • Wishlist
  • About Me

Flailing Wildly
Too much straw, not enough camel.

To Infinity And Beyond!

by Ryan Parman • October 2, 2003 • Code • 4 comments

I’ve discovered something cool about JavaScript… not something useful, but something cool. I’ve discovered the end of the rainbow, or at least the Math object.

I was sitting at home in my underwear eating Cheetos® and watching Cartoon Network this past Saturday, when something dawned on me. I recalled a conversation I had with my best frind about 8 years ago about the Mac’s 256, Thousands, and Millions of colors versus Windows 8, 16, and 24-bit color. He was saying that he was excited because he’d pushed his Windows 95 computer to display 16.7 million colors.

It was Saturday when the obvious struck me. Mac OS’s “Millions” of colors is equal to 16,777,216 colors, which is equal to Windows’ 24-bit color, because in binary, 111111111111111111111111 is equal to 16,777,216 in decimal. Duh!

For the next few hours, my brain was into binary. I licked the cheese powder off my fingers, turned off the TV, put some pants on, and sat down at my computer. A few months ago, I wrote a Number Conversion Object that is able to convert between Decimal (base 10) and Binary (base 2). I decided to put it to use.

From there, my mind wandered into video games. Nintendo was 8-bit (256 colors), Super Nintendo and Sega Genesis were 16-bit (65,536 colors), Sony Playstation and Sega Saturn were 32-bit (4,294,967,296 colors). JavaScript’s Math object gets a little flaky if the numbers get too big. It’ll hold the places with zeroes. I went ahead with the next calculations. Atari Jaguar and Nintendo 64 were 64-bit (18,446,744,073,709,552,000 colors). I don’t even know how many “-illions” that is.

Current video game systems are 128-bit. That translates to 3.402823669209385 x1038. That’s a freakin’ big number. Then I began thinking about encryption. Most browsers have 128-bit encryption. Some security applications have 256-bit encryption. I haven’t heard of 512-bit encryption, but I’m sure it’s out there.

  • 256-bit: 1.157920892373162 x 1077
  • 512-bit: 1.3407807929942597 x 10154

WOW! Those numbers are huge! In binary, 512 bits is written as 512 “1’s” right next to each other. And 10154 is a 1 with 155 zeroes behind it. A billion only has 9 zeroes behind it.

Then I decided to push it one step further, and I discovered something particularly interesting. What you will see in the next paragraph is your browser’s rendering of the number that JavaScript produces for a 1024-bit number. Here we go…

I feel like I’ve discovered the end of the universe or something. I’m having a tough time comprehending how big that number actually is.

As I said earlier, it’s not very useful, but it is kinda cool.

Ryan Parman

Ryan Parman is an entrepreneur, open source evangelist and passionate usability advocate currently living in Seattle. He is the founder and visionary behind SimplePie and CloudFusion, co-founder of WarpShare, member of the RSS Advisory Board, and creator of the AWS SDK for PHP. Ryan's aptly-named blog, Flailing Wildly, is where he writes about ideas longer than 140 characters.

« Season Premiere of Alias
Slickly Packaged Garbage »

Discussion

Corey Thompson

October 22, 2003

Actually, this is a really cool find. When you said, ” I haven’t heard of 512-bit encryption, but I’m sure it’s out there.”, that reminded me of a piece of security software I came across, but cannot remember the name of. It actually claimed to have 1024 bit encryption. Pretty hard to crack, that!

 

Ryan Parman

October 22, 2003

Yeah, 1024-bit would be pretty hard to crack, and I’m sure that you’d need a pretty powerful computer just for the computation involved.

1023-bit comes up as (if my memory serves me correctly) 10 to the 377th power, or something ridiculous like that…

 

Sean Kennedy

December 19, 2003

1024 would be exceptionally difficult to crack, but not impossible. All though your calculator reads back “infinity” for an answer, I think that 1024 would come up as something x 10^308, if you think about it correctly. It seems that every 2x jump in the bit scheme makes the power of 10 jump 2x. So, it seems that that number would still be rational, at least. Maybe I’m wrong, but i think your browser just doesn’t handle numbers that high.

 

Sean Kennedy

December 19, 2003

1024 would be exceptionally difficult to crack, but not impossible. All though your calculator reads back “infinity” for an answer, I think that 1024 would come up as something x 10^308, if you think about it correctly. It seems that every 2x jump in the bit scheme makes the power of 10 jump 2x. So, it seems that that number would still be rational, at least. Maybe I’m wrong, but i think your browser just doesn’t handle numbers that high.

 

Comments for this post are now closed.

Blog search

Archives
  • 2016 (1)
  • 2015 (3)
  • 2014 (6)
  • 2013 (15)
  • 2012 (16)
  • 2011 (27)
  • 2010 (9)
  • 2009 (6)
  • 2008 (12)
  • 2007 (8)
  • 2006 (18)
  • 2005 (57)
  • 2004 (104)
  • 2003 (103)
Categories
  • Apple (62)
  • Browsers (56)
  • Cloud Computing (5)
  • Clueless Recruiters (9)
  • Code (60)
  • Community (2)
  • Creating Websites (32)
  • Culture (8)
  • Design (7)
  • Digital Media (9)
  • Family Life (12)
  • Just for Fun (27)
  • Law (2)
  • Life Lessons (2)
  • Music (5)
  • Notable Quotes (1)
  • Passwords (4)
  • Personal (41)
  • Political (17)
  • Projects (49)
  • Security (6)
  • Software (69)
  • Syndication (28)
  • Technology (92)
  • The Hiring Process (1)
  • Tutorials (9)
  • TV and Movies (17)
  • Video Games (6)
  • Website (62)
  • Work and Business (8)
  • Writing (4)
Socially-aware

Twitter • Facebook • YouTube • Yelp! • Flickr • Instagram • Zerply • LinkedIn • Last.fm • Spotify • Rdio • Pinboard • gdgt

Claim to fame
  • Amazon Web Services
  • WarpShare
  • CloudFusion
  • SimplePie
Legal mumbo-jumbo

All ideas, opinions and comments I post are my own and are in no way affiliated with anybody I work with. If you quote and/or reprint something I've written or said, please direct folks back to this site as a form of attribution. I promise I'll do the same for you. Unless otherwise noted, all content on this site is copyright © 1979–2011 Ryan Parman.

Powered by Rocket Sauce. A Ryan Parman production.