Might be better to use phpBB's unique_id function for this which has better randomness because it uses a seed stored in the database.