rfc:reference_reflection

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:reference_reflection [2019/01/15 10:54] – Make ctor private, rename to fromArrayElement nikicrfc:reference_reflection [2019/01/30 10:02] nikic
Line 70: Line 70:
 </code> </code>
  
-The value returned by ''getId()'' is based on the address of the ''zend_reference'' structure, which is used internally to represent references. To avoid directly leaking memory addresses, which would facilitate attacks requiring knowledge of memory layout, the address is SHA1 hashed together with a per-process 128-bit key. The raw 20 byte digest is returned (not hex encoded). In other words, the return value of ''getId()'' is ''sha1(address_of($ref) . $key, true)''. As mentioned above, the specific scheme used here is an implementation detail and may change in the future.+The value returned by ''getId()'' is based on the address of the ''zend_reference'' structure, which is used internally to represent references. To avoid directly leaking memory addresses, which would facilitate attacks requiring knowledge of memory layout, the address is SHA1 hashed together with a per-process 128-bit key. The raw 20 byte digest is returned (not hex encoded). In other words, the return value of ''getId()'' is ''sha1(address_of($ref) . $key, true)''. 
 + 
 +As mentioned above, the specific scheme used here is an implementation detail and may change in the future. The length of the string may change, and the return value may be converted into an integer in the future, if it becomes technically feasible.
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
rfc/reference_reflection.txt · Last modified: 2019/02/13 11:26 by nikic