This is a deno version of node-steam-totp by DoctorMcKay
It's a port of his module, just a little bit different.
import * as SteamTotp from 'https://deno.land/x/steamtotp@v3.0.1';
Generate a Steam-style TOTP authentication code.
Generate a base64 confirmation key for use with mobile trade confirmations. The code can only be used once.
options?: {
time?: number;
tag?: "conf" | "details" | "allow" | "cancel";
}
Get a standardized device ID based on your SteamID.
steamID - Your SteamID, either as a string or as an object which has a toString() method that returns the SteamID
STEAM_TOTP_SALT
is not supported.
The algorithm used is:
- Convert the SteamID to a string
- Append the value of the
salt
param to the SteamID, If It's set - SHA-1 hash it and encode the resulting hash as a lowercase hex value
- Truncate the hash to 32 characters
- Insert dashes such that the resulting value has 5 groups of hexadecimal values containing 8, 4, 4, 4, and 12 characters, respectively
- Prepend "android:" to the resulting value
Returns the current local Unix time
Returns offset between you and steam servers in seconds