Votp
otp module for v, written in v
Install / Use
/learn @OdaiGH/VotpREADME
V OTP 0.1
votp enables you to add TOTP or HOTP functionaltiies in your code the V programming language.
Installation
v up
v install OdaiGH.votp
Usage
Time-based one-time password is as follows
>>> import odaigh.votp
>>> totp := new_totp("YOUR_SECRET", 6, "TYPE_OF_DIGEST", INTERVAL_IN_SECONDS) // DIGESTS SUPPORT are {sha1,sha256,sha512}
>>> totp := new_totp("odai alghamdi", 6, "sha512", 30)
>>> generated_otp := totp.generate_totp()
214205
>>> verify_otp := totp.verify(214205) //verify if given otp at the current time is correct
true
>>> verify_otp := totp.verify(123456)
false
HMAC-based one-time password is as follows
>>> import odaigh.votp
>>> totp := new_hotp("YOUR_SECRET", 6, "TYPE_OF_DIGEST") // DIGESTS SUPPORT are {sha1,sha256,sha512}
>>> totp := new_hotp("base32secret3232", 6, "sha512")
>>> generated_otp := hotp.generate_hotp(COUNTER) // COUNTER for your hmac otp
>>> generated_otp := hotp.generate_hotp(0) // COUNTER for your hmac otp
492039
>>> verify_otp := hotp.verify(492039,0) //verify if given otp at the current counter is correct
true
>>> verify_otp := hotp.verify(492039,1)
false
License
V otp is licensed under MIT.
Contributing
Follow the instructions in CONTRIBUTING.md
Related Skills
node-connect
351.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
