Integrate Signup Code with Private Groups?

Ideally I'd really like to have a different signup code for each individual group on a buddypress network. That way each user can gain access to a private group which corresponds with their code.

They will then be registered for the network AND for a specific group at initial registration.

Thanks.