Refined hex encoding