News for hackers. Stuff that matters.
Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by tonyg on Wednesday October 23, 2024 @07:18AM (#41923825)
Where does the 6^16 come from? There are only 16.7 million 24-bit RGB triples; naively, if you're treating 3-hexit and 6-hexit colours separately, that'd be 16,781,312 distinct pages. What am I missing?
Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by damir on Wednesday October 23, 2024 @07:46AM (#41923973)
6 positions, each 0-F value gives 6^16 options, yes?
Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by nojvek on Wednesday October 23, 2024 @08:42AM (#41924476)
Not really.

When numbers repeat, the value is the same. E.g 00 is the same as 00.

So the possible outcomes is 6^16, but unique values per color channel is only 256 values.

So unique colors are 256^3 = 16.7M colors.

Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by damir on Wednesday October 23, 2024 @08:50AM (#41924543)
Yes, each possible 6^16 outcome is it's own subpage...

/000000 /000001 /000002 /000003 etc...

Or am I missing something?

Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by elpocko on Wednesday October 23, 2024 @10:22AM (#41925307)
16^6 == 256^3 == 2^24 == 16,777,216
Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by basic_ on Wednesday October 23, 2024 @09:15AM (#41924760)
you mean 16^6
Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by kelnos on Thursday October 24, 2024 @01:39AM (#41932269)
You have it backward. There are 16^6 URLs, not 6^16.
Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by mkl on Thursday October 24, 2024 @06:03AM (#41933989)
You are missing something. How many two-digit decimal numbers are there from 00 to 99? Obviously 99+1 = 100: 10 options for the first digit times 10 options for the second digit; 10 in the form 0X, 10 in the form 1X, etc. up to 9X, a total of 10 * 10 = 10^2.

So how many 6-digit hexadecimal numbers from 0x000000 to 0xffffff? 0xffffff+1 = 16777216 = 16^6. 16 options for the first digit, times 16 options for the second digit, times 16 for the 3rd, times 16 for the 4th, times 16 for the 5th, times 16 for the 6th is 16^6. Or go to bytes: 3 bytes, each with 256 possible values is 256^3 = (16^2)^3 = 16^6. Or bits: 2^24 = (2^4)^6 = 16^6.

It's also pretty trivial to just count them. Run this in your browser console:

  count = 0; for(i = 0x000000; i <= 0xffffff; i++) { count++; } console.log(count, 16**6, 0xffffff+1, 6**16)
Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by Y_Y on Thursday October 24, 2024 @03:50AM (#41933107)
256^3 == (16^2)^3 == 16^(3*2) == 16^6
Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by nojvek on Saturday October 26, 2024 @01:07PM (#41956070)
Yes.

16^6 is not 6^16.

Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by tromp on Thursday October 24, 2024 @04:21AM (#41933321)
If you think 3 positions, each 0-1, gives 3^2 options, then please show us the 9th three-bit number. Even simpler is the case of 1 position that is 0-1. Does that give 1^2 or 2^1 options?
Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by 123yawaworht456 on Thursday October 24, 2024 @04:41AM (#41933458)
1 byte (8 bits) is 2^8 (256 unique combinations of bits)

3 bytes (24 bits) is 2^24 (16777216 unique combinations of bits)

Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by ColinWright on Thursday October 24, 2024 @05:12AM (#41933652)
You have 6 hex characters.

The first has 16 possible values;

The second also has 16 possible values for each of those 16, so now we have 16 times 16.

etc.

So it's a choice from 16, repeated for a total of 6 times.

That's 16 times 16 times ... times 16, which is 16^6.

Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by albedoa on Thursday October 24, 2024 @11:19AM (#41936382)
Welp, you got me scrolling your HN thread to see where the "two-trillion-something" number came from. Between this and your experiment site, you have a knack for drawing attention.
Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by razodactyl on Thursday October 24, 2024 @12:17AM (#41931853)
I swear this thread turned me temporarily dyslexic: 16^6 is different to 6^16.

6 up 16 is a very large number.

16 up 6 is a considerably smaller number.

(I read it that way in my head since it's quicker to think without having to express "to the power of" internally)

Re:Ask HN: Website with 6^16 subpages and 80k+ daily bots by smitelli on Thursday October 24, 2024 @09:26AM (#41935262)
16,781,312 is the answer I got too.

One hex digit (0-F) is four bits. Six hex digits is (46) 24 bits. 24 bits is (2^24) 16.7 million combinations.

It is also legal to use three-digit colors in CSS, where (e.g.) #28d expands to #2288dd. In that context there are (43) 12 bits expressing (2^12) 4,096 colors. None of the three-digit codes from this group produce the same URL in the previous group, although all of the colors drawn on the screen are the same. For OP's purposes, these URLs are added to the others.

If one were to want to blow it up further, it's also legal to have an eight-digit hex code, where the rightmost two digits encode 256 possible levels of transparency for each color. That produces ~4 billion combinations.