This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object SteamTOTPConverter { | |
private val base26Chars = "0123456789ABCDEFGHIJKLMNOP" | |
private val steamChars = "23456789BCDFGHJKMNPQRTVWXY" | |
private val charMap = (base26Chars zip steamChars) toMap | |
private def toBase26(number: Int) = Integer.toString(number, 26).toUpperCase | |
def convertFrom(totpToken: Int) = { | |
toBase26(totpToken) | |
.takeRight(5) |