wrapped encoding to GCD