Requires the Hack Standard Library to be installed.
Facebook Engineer?

This function is available as Math\from_base() in Facebook's www repository.

Converts the given string in the given base to an int, assuming letters a-z are used for digits when $from_base > 10

namespace HH\Lib\Math;

function from_base(
  string $number,
  int $from_base,
): int;

To base convert an int into a string, see Math\to_base().


  • string $number
  • int $from_base


  • int