Returns the part of an object to be used to calculate its hash.
hash_input(x)# S3 method for `function`
hash_input(x)
# S3 method for data.table
hash_input(x)
# S3 method for list
hash_input(x)
# S3 method for default
hash_input(x)
(any)
Object for which to retrieve the hash input.
hash_input(`function`): The formals and the body are returned in a list().
This ensures that neither the bytecode nor the parent environment are included in the hash.
Source references are removed from the body, so that the hash does not depend on the formatting
of the definition or on its position in a source file.
Primitives have neither formals nor a body and are returned as is.
hash_input(data.table): The data.table is converted to a regular list and hash_input() is applied to all elements.
The conversion to a list ensures that keys and indices are not included in the hash.
hash_input(list): hash_input() is applied to all elements of the list.
hash_input(default): Returns the object as is.