Bitcoin Forum
November 17, 2024, 01:35:33 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Chicken and egg hash  (Read 451 times)
yokosan (OP)
Hero Member
*****
Offline Offline

Activity: 700
Merit: 500


View Profile
April 22, 2013, 10:55:56 AM
 #1

Bit of a strange question but it may be semi-relevant to this forum.

Let's say I want to create a program. This program will work out the SHA-256 hash of itself and use the hash to check it's own validity.

In order to do this you will need to know the hash of the code before the code has been written, so how would you do it?

(almost) impossible?
Phinnaeus Gage
Legendary
*
Offline Offline

Activity: 1918
Merit: 1570


Bitcoin: An Idea Worth Spending


View Profile WWW
April 22, 2013, 11:08:49 AM
 #2

Bit of a strange question but it may be semi-relevant to this forum.

Let's say I want to create a program. This program will work out the SHA-256 hash of itself and use the hash to check it's own validity.

In order to do this you will need to know the hash of the code before the code has been written, so how would you do it?

(almost) impossible?

Thanks alot, bud! Now BFL will be pre-selling another contraption.
organofcorti
Donator
Legendary
*
Offline Offline

Activity: 2058
Merit: 1007


Poor impulse control.


View Profile WWW
April 22, 2013, 11:09:50 AM
 #3

Damnit! I thought this would be a recipe thread.

Bitcoin network and pool analysis 12QxPHEuxDrs7mCyGSx1iVSozTwtquDB3r
follow @oocBlog for new post notifications
Phinnaeus Gage
Legendary
*
Offline Offline

Activity: 1918
Merit: 1570


Bitcoin: An Idea Worth Spending


View Profile WWW
April 22, 2013, 11:19:35 AM
 #4

Damnit! I thought this would be a recipe thread.

IBFmatthew:

Stewed Dog (wedding style)

 Recipe By     : Joe Sweeney
 Serving Size  : 30   Preparation Time :3:00
 Categories    : Ethnic                           Lamb
                 Philippines
 
   Amount  Measure       Ingredient -- Preparation Method
 --------  ------------  --------------------------------
    3      kg            dog meat -- * see note
    1 1/2  cups          vinegar
   60                    peppercorns -- crushed
    6      tablespoons   salt
   12      cloves        garlic -- crushed
      1/2  cup           cooking oil
    6      cups          onion -- sliced
    3      cups          tomato sauce
   10      cups          boiling water
    6      cups          red pepper -- cut into strips
    6      pieces        bay leaf
    1      teaspoon      tabasco sauce
    1 1/2  cups          liver spread -- ** see note
    1      whole         fresh pineapple -- cut 1/2 inch thick
 
 1. First, kill a medium sized dog, then burn off the fur over a hot fire.
 2. Carefully remove the skin while still warm and set aside for later (may be
used in other recpies)
 3. Cut meat into 1″ cubes. Marinade meat in mixture of vinegar, peppercorn,
salt and garlic for 2 hours.
 4. Fry meat in oil using a large wok over an open fire, then add onions and
chopped pineapple and suate until tender.
 5. Pour in tomato sauce and boiling water, add green peper, bay leaf and
tobasco.
 6. Cover and simmer over warm coals until meat is tender. Blend in liver spread
and cook for additional 5-7 minutes.
 
 * you can substiture lamb for dog. The taste is similar, but not as pungent.
 ** smooth liver pate will do as well.
benjamindees
Legendary
*
Offline Offline

Activity: 1330
Merit: 1000


View Profile
April 24, 2013, 09:29:41 AM
 #5

The way this is usually done is to place the hash at the end of the binary after it's been compiled, with the code referencing this point.

Civil Liberty Through Complex Mathematics
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!