How to change uploaded file name after save node? Hello and thanks for looking my question.

On Drupal 7 I use this hook hook_file_presave() for change file name.

function mymodule_file_presave($file) {
  $parts = pathinfo($file-&gt;filename);
  $file-&gt;filename = $file-&gt;uid . $file-&gt;timestamp . '.' . $parts['extension'];
}


But how to do it on Drupal 8.1.x? Programmatically or module ways or something else?
hook_entity_presave?

Description from the DocBlock:


  Act on an entity before it is created or updated.
  You can get the original entity object from $entity-&gt;original when it is an update of the entity.