4

solidity doc says:

0x00 - 0x3f (64 bytes): scratch space for hashing methods

how can i understand "scratch space for hashing methods" ?

Petr Hejda
  • 40,554
  • 8
  • 72
  • 100
jayphbee
  • 41
  • 1
  • I'm not an expert with Solidity, but this means there is space allocated in the memory that will be used to temporarily store data during calculations. You can think of it like a chalkboard where some calculations will be done/stored, then erased or overwritten. Presumably the hashing methods used require some temporary storage space during computation. But this chalkboard needs to be created/allocated beforehand as part of the structure. – nullromo Oct 22 '21 at 23:44

1 Answers1

2

Simply put, these 64 bytes of space will be used by hashing methods (e.g., keccak256) which need a temporary space to store intermediate outputs before ultimately returning a final output.

In hash functions, there are a lot of steps involved and the output of one step is the input for the next. This makes it necessary to have a reserve space available to perform these workings and store the intermediate outputs.

Hasan Raza
  • 81
  • 3