need to generate unique id from constant sid

Hello
I have multiple accounts that running application that uses unique port number
I want to generate this port from some sid number that stays constant for every user account , is there any place in the system
that generate number that is unique to the account ?
thanks