Id encode