Generating user codes