Skip to content

Commit

Permalink
Tidy newlines and return param (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg authored Jun 28, 2024
1 parent ce3773d commit 8f60c24
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions otp.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,12 @@ func (k *Key) Period() uint64 {

// Digits returns the digits value.
func (k *Key) Digits() uint {
var u uint

if digits := k.values.Get("digits"); digits != "" {
if val, err := strconv.ParseUint(digits, 10, 32); err == nil {
u = uint(val)
return uint(val)
}
}

return u
return 0
}

// Counter returns the counter value.
Expand All @@ -147,7 +144,6 @@ func (k *Key) Counter() uint64 {
return val
}
}

return 0
}

Expand All @@ -163,7 +159,6 @@ func (k *Key) Algorithm() Algorithm {
return AlgorithmSHA512
}
}

return AlgorithmUnknown
}

Expand Down

0 comments on commit 8f60c24

Please sign in to comment.