Repository
Current version released
4 years ago
Dependencies
std
deno-steam-totp
This is a deno version of node-steam-totp by DoctorMcKay
It’s a port of his module, just a little bit different.
generateAuthCode( secret: string | Buffer, timeOffset?: number): string
Generate a Steam-style TOTP authentication code.
generateConfirmationCode (identitySecret: Buffer | string, options: Options): string
Generate a base64 confirmation key for use with mobile trade confirmations. The code can only be used once.
options
options?: {
time?: number;
tag?: "conf" | "details" | "allow" | "cancel";
}
getDeviceID(steamID: string | object, salt?: string): string
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
getLocalUnixTime(offset = 0): number
Returns the current local Unix time
getTimeOffset(): Promise<number>
Returns offset between you and steam servers in seconds