mirror of
https://github.com/ente-io/ente.git
synced 2025-08-01 06:32:01 +00:00
16 lines
303 B
Go
16 lines
303 B
Go
package random
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/ente-io/museum/pkg/utils/auth"
|
|
"github.com/ente-io/stacktrace"
|
|
)
|
|
|
|
func GenerateSixDigitOtp() (string, error) {
|
|
n, err := auth.GenerateRandomInt(1_000_000)
|
|
if err != nil {
|
|
return "", stacktrace.Propagate(err, "")
|
|
}
|
|
return fmt.Sprintf("%06d", n), nil
|
|
}
|