code: func (h *hasher) hashChildren(original node, db *Database) (node, node, error) {
  	var err error
  
  	switch n := original.(type) {
  	case *shortNode:
  		// Hash the short node's child, caching the newly hashed subtree
  		collapsed, cached := n.copy(), n.copy()
  		collapsed.Key = hexToCompact(n.Key)
  		cached.Key = common.CopyBytes(n.Key)
  
  		if _, ok := n.Val.(valueNode); !ok {
  			collapsed.Val, cached.Val, err = h.hash(n.Val, db, false)
  			if err != nil {
  				return original, original, err
  			}
  		}
  		return collapsed, cached, nil
  
  	case *fullNode:
  		// Hash the full node's children, caching the newly hashed subtrees
  		collapsed, cached := n.copy(), n.copy()
  
  		for i := 0; i < 16; i++ {
  			if n.Children[i] != nil {
  				collapsed.Children[i], cached.Children[i], err = h.hash(n.Children[i], db, false)
  				if err != nil {
  					return original, original, err
  				}
  			}
  		}
  		cached.Children[16] = n.Children[16]
  		return collapsed, cached, nil
  
  	default:
  		// Value and hash nodes don't have children so they're left as were
  		return n, original, nil
  	}
  }
docs: // hashChildren replaces the children of a node with their hashes if the encoded
  // size of the child is larger than a hash, returning the collapsed node as well
  // as a replacement for the original node with the child hashes cached in.