Here goes nothing

This commit is contained in:
2024-11-21 18:27:46 -05:00
parent 108f7b235f
commit b790dc3013
2 changed files with 41 additions and 3 deletions

View File

@@ -151,6 +151,14 @@ func getCode(configName string) *C.char {
return cCode
}
//export getCodeFromI
func getCodeFromI(index int) *C.char {
code := configs[index].TOTP()
cCode := C.CString(code)
runtime.KeepAlive(code)
return cCode
}
//export getTimeRemaining
func getTimeRemaining(n int) uint64 {
return uint64(n) - (uint64(time.Now().Unix()) % uint64(n))