News for hackers. Stuff that matters.
Re:Show HN: I wrote a script to turn a webpage into bitmap H... by viraptor on Friday December 31, 2010 @01:02PM (#2055944)
Calculate `h=SHA256(original_page)` and `n=len(original_page)`.

    do
      page = gen_random_bytes(n)
    while (h != SHA256(page))
    print page
It can be even generated client-side!
Re:Show HN: I wrote a script to turn a webpage into bitmap H... by wwortiz on Friday December 31, 2010 @01:23PM (#2055993)
Can't the same hash mean different data?
Re:Show HN: I wrote a script to turn a webpage into bitmap H... by viraptor on Friday December 31, 2010 @02:52PM (#2056268)
Well, sure. But if you add another check for likelihood that `page` is fairly-correct html in utf8, there should be around one correct result really :) If you get 2, the other one is probably a <form> you can use to sell your soul to satan - do not hit submit if you get it.
Re:Show HN: I wrote a script to turn a webpage into bitmap H... by stcredzero on Friday December 31, 2010 @08:28PM (#2056996)
The problem with this, is that the random bytes in one iteration of the loop might be closer to the page than the next iteration, so there would be reverse progress in that instance. This entry would be disqualified.
Re:Show HN: I wrote a script to turn a webpage into bitmap H... by meric on Friday December 31, 2010 @10:37PM (#2057156)

    page_bytes = bytes(size_of(bytes_of(page)))
    do
      page_bytes += 1
    while (page_bytes != bytes_of(page))
    print page