const fn gen_discriminant(category: Category, id: u16) -> u32