News for hackers. Stuff that matters.
Re:Itty Bitty: Sites contained within their own links by ryanpetrich on Thursday July 05, 2018 @12:49AM (#17460921)
Re:Itty Bitty: Sites contained within their own links by erdemozg on Thursday July 05, 2018 @02:24AM (#17461216)
It's like an image containing its own SHA2 hash. How is it possible?
Re:Itty Bitty: Sites contained within their own links by lurenjia on Thursday July 05, 2018 @03:30AM (#17461474)
Clever use of Javascript.

  <a><script src="https://itty.bitty.site/lzma/lzma_worker-min.js"></script> 
 <script>a=document.querySelector('a');LZMA.compress(a.outerHTML,9,function(r){a.innerText=a.href='https://itty.bitty.site/#/?'+btoa(String.fromCharCode.apply(null,new Uint8Array(r)))})</script></a>
Re:Itty Bitty: Sites contained within their own links by mankash666 on Thursday July 05, 2018 @03:59PM (#17466311)
This makes the whole "Sites contained within their own links" untrue. You need a server to host the javascript.
Re:Itty Bitty: Sites contained within their own links by saurik on Thursday July 05, 2018 @03:13AM (#17461413)
A quine is more similar to (but not quite the same as) an uncompressed image containing a QR code with a compressed copy of the same image, which has its own challenges; but like, a cryptographic hash function (such as SHA2) is designed explicitly to make this hard... if you had chosen a simple checksum instead it would be trivial to create an image containing the text of a checksum of the image: a compression function (particularly a tiny custom one designed for this one time use, that removes barely any entropy at all) is predictable enough to be manipulated. (edit: I hadn't looked at this one, though; but now that I see its code, apparently it is just cheating by accessing its own code via the DOM; it doesn't need to do that, and it doesn't even really feel like a "quine" to me given this implementation.)
Re:Itty Bitty: Sites contained within their own links by Avamander on Thursday July 05, 2018 @05:25AM (#17461894)
You can create videos on YouTube too that contain it's own URL.
Re:Itty Bitty: Sites contained within their own links by erdemozg on Thursday July 05, 2018 @06:43AM (#17462181)
For anyone wondering how is this possible I've made a quick research and the method is in the description part of this youtube video: https://www.youtube.com/watch?v=ufq2Eb78kSU

In short, Youtube API's resume upload function can be abused to achieve this.

Re:Itty Bitty: Sites contained within their own links by sirsuki on Thursday July 05, 2018 @12:22PM (#17464491)
An example of a functional quine: https://tiddlywiki.com/#Quine
Re:Itty Bitty: Sites contained within their own links by ponyfleisch on Thursday July 05, 2018 @12:59AM (#17460965)
nice! how did you do it?
Re:Itty Bitty: Sites contained within their own links by ryanpetrich on Thursday July 05, 2018 @08:58PM (#17468150)
As others have pointed out, it's not quite a quine and just some silly JavaScript that reads out its source from the DOM and feeds it back into a copy of Itty Bitty's URL generation algorithm.