Transformer: add hex encoder