We all know very well that salesforce ID is unique and hence you may use formula like 'UNIQ-'+Id

So your external Id will be UNIQ-+salesforceID(18 digit)