Sorry, please can you explain that again. I got as far as TOTP, and now all I can think about is Pan's People dancing provocatively in satin hotpants to Shawaddywaddy on Top of The Pops.
That’s exactly how it works.
When time based the app takes the current time
Not the precise time as the server also needs to make the calculation, so will use something of an approximation
Eg both the server and the app look up the current date/time, the server gets 21 Jan 2023 10:51:45 and when you click on the app it gets 21 Jan 2023 10:52:10.
The algorithm may choose to truncate away the seconds and minutes giving a common result of 21 jan 2023 10:5
The app runs an algorithm formula which comes up with a year between 1968 and 1976, a week number (episode) and a counter between 1 and 30
It then scans its encrypted TOTP database for the nearest Pans People performance (in case of multiple tracks per episode) and comes up with an artist name - Shawaddywaddy
Each letter in the artist name is attributed a number and a second algorithm formula gives a short code number
The user enters that short code number
The server reverses the second algorithm to reveal Shawaddywaddy, cross references its TOTP database for all possible Pans People Shawaddywaddy performance episode time slots.
For each of those results it reverses the first algorithm to see if any of the time results match the timestamp that the process began
If one is right then you get in, but if the code sent back was for Wizzard then you get two more chances before being locked out
Some other systems are based on Hot Gossip and the Kenny Everett show