Forum Academy Marketplace Showcase Pricing Features

Calulate Random String Question

Hi ,

I am making a referral system and using the calculate random string to generate a 5 digit code.This all works properly.
My question is

  1. Is there any way to search the users, to make sure no other user has the same 5 digit promo code generated?
    This is how I am tracking referrals so no 2 users can have the same code.