How to iterate through list in storage?

I need to determine if a player id is in a storage list.

Storage name:playerid {id: [8775, 6445, 8991, ...]}

When a new player id is created, I need to know if it already exists so it can be re-generated. (Player id's are made up of 4 non-negative numbers, and are generated randomly)

The player id's are normally stored in a scoreboard [playerid]. But are also added to the storage above.

Continue to help post