[FOLD] to_hex in reverse and update javadoc