function so_3261107_hash_filename( $filename ) {
$info = pathinfo( $filename );
$ext = empty( $info['extension'] ) ? '' : '.' . $info['extension'];
$name = basename( $filename, $ext );
return md5( $name . time() ) . $ext;
}
add_filter( 'sanitize_file_name', 'so_3261107_hash_filename', 10 );