Need a quick easy way to generate affiliate links.

Need a quick easy way to generate affiliate links.

?ref=AFFILIATE-00

Not sure how this is calculated.

Would be great to have a shortcode for the affiliate links and banners.

Worse case php code.

Can you guys help with a php script?

Thank you