What is the OpenAI algorithm to calculate tokens?

Here is the correct link

Previous post deleted to avoid confusion