.sql". * * @param string $stem Readable part, without extension. * @param string $ext Extension including the dot, ".sql" or ".sql.gz". */ public static function make( string $stem, string $ext ): string { return $stem . '-' . bin2hex( random_bytes( 16 ) ) . $ext; } /** The name to show or download as: the same file, minus its random suffix. */ public static function display( string $basename ): string { return (string) preg_replace( self::SUFFIX, '', $basename ); } }