fix: build for 32-bit platform

This commit is contained in:
Hintay 2025-02-10 14:57:26 +09:00
parent 9184711d43
commit 69a7f38ba7
No known key found for this signature in database
GPG key ID: 120FC7FF121F2F2D
2 changed files with 3 additions and 3 deletions

View file

@ -19,8 +19,8 @@ type RecoveryCodesResponse struct {
}
func generateRecoveryCode() string {
// generate recovery code, 10 hex numbers
return fmt.Sprintf("%010x", rand.Intn(0x10000000000))
// generate recovery code, 10 hex numbers with a dash in the middle
return fmt.Sprintf("%05x-%05x", rand.Intn(0x100000), rand.Intn(0x100000))
}
func generateRecoveryCodes(count int) []model.RecoveryCode {

View file

@ -108,7 +108,7 @@ function handlePopOpenChange(visible: boolean) {
<ul class="grid grid-cols-2 gap-2 text-lg">
<li v-for="(code, index) in codes" :key="index">
<span :class="{ 'line-through': code.used_time }">
{{ `${code.code.slice(0, 5)}-${code.code.slice(5)}` }}
{{ code.code }}
</span>
</li>
</ul>