How do i parse/strinigfy number with a specific radix/base

In javascript we can do parseInt(n,radix); or n.toString(radix);
I see that in Haxe these params are missing.
Are there any ready code in Haxe Std to do the same?

I found here Converting an Integer to Any Base a fairly simple implementation in python

CHAR_FOR_INT = '0123456789abcdef'


def to_string(n, base):
    if n < base:
        return CHAR_FOR_INT[n]

    return to_string(n // base, base) + CHAR_FOR_INT[n % base]

to_string(1453, 16)  # => 5Ad

or this in reverse

def to_decimal(number, base):
    result = 0
    for index, character in enumerate(number):
        result += int(character) * base ** index
    return result

Anything native haxe?

Haxe has StringTools.hex() specifically for radix 16. I haven’t seen anything for an arbitrary radix, though.

You can check the convert method in UUID lib ( Uuid.convert(… )
( GitHub - flashultra/uuid: Generates the RFC-4122 UUIDs)

Example :

  Uuid.convert("273247893827239437",Uuid.NUMBERS_DEC,Uuid.NUMBERS_HEX);  // --> convert decimal to hex
  Uuid.convert("10101111000101010",  Uuid.NUMBERS_BIN, Uuid.NUMBERS_HEX); // --> convert binary to hex

Thx.core has a similar function: Ints.toString(value:Int, base:Int) (or the Ints.toBase() alias)