Transforming variable-length to fixed keys