@@ -19,7 +19,7 @@ pub struct TOTP {
19
19
/// The secret key used in the HMAC process.
20
20
///
21
21
/// Often given as a Base32 key, which can be conveniently initialized using
22
- /// [`TOTP::from_base32 `] constructors.
22
+ /// [`TOTP::default_from_base32 `] constructors.
23
23
secret : Vec < u8 > ,
24
24
25
25
/// The digest to use in the HMAC process.
@@ -71,31 +71,31 @@ impl TOTP {
71
71
///
72
72
/// Defaults to using [`MacDigest::SHA1`] as the digest for HMAC operations,
73
73
/// 6 digits and a 30 seconds period.
74
- pub fn from_secret ( secret : & [ u8 ] ) -> Self {
75
- TOTP :: from_secret_with_digest ( secret, MacDigest :: SHA1 )
74
+ pub fn default_from_secret ( secret : & [ u8 ] ) -> Self {
75
+ TOTP :: default_from_secret_with_digest ( secret, MacDigest :: SHA1 )
76
76
}
77
77
78
78
/// Creates a new TOTP instance with a byte-array representation of the secret and
79
79
/// a digest algorithm.
80
80
///
81
81
/// Defaults to using 6 digits and a 30 seconds period.
82
- pub fn from_secret_with_digest ( secret : & [ u8 ] , mac_digest : MacDigest ) -> Self {
82
+ pub fn default_from_secret_with_digest ( secret : & [ u8 ] , mac_digest : MacDigest ) -> Self {
83
83
TOTP :: new ( secret, mac_digest, 6 , 30 )
84
84
}
85
85
86
86
/// Creates a new TOTP instance with an utf8 representation of the secret.
87
87
///
88
88
/// Defaults to using [`MacDigest::SHA1`] as the digest for HMAC operations,
89
89
/// 6 digits and a 30 seconds period.
90
- pub fn from_utf8 ( secret : & str ) -> Self {
91
- TOTP :: from_utf8_with_digest ( secret, MacDigest :: SHA1 )
90
+ pub fn default_from_utf8 ( secret : & str ) -> Self {
91
+ TOTP :: default_from_utf8_with_digest ( secret, MacDigest :: SHA1 )
92
92
}
93
93
94
94
/// Creates a new TOTP instance with an utf8 representation of the secret and
95
95
/// a digest algorithm.
96
96
///
97
97
/// Defaults to using 6 digits and a 30 seconds period.
98
- pub fn from_utf8_with_digest ( secret : & str , mac_digest : MacDigest ) -> Self {
98
+ pub fn default_from_utf8_with_digest ( secret : & str , mac_digest : MacDigest ) -> Self {
99
99
TOTP :: new_from_utf8 ( secret, mac_digest, 6 , 30 )
100
100
}
101
101
@@ -106,8 +106,8 @@ impl TOTP {
106
106
///
107
107
/// # Panics
108
108
/// This method panics if the provided string is not correctly base32 encoded.
109
- pub fn from_base32 ( secret : & str ) -> Self {
110
- TOTP :: from_base32_with_digest ( secret, MacDigest :: SHA1 )
109
+ pub fn default_from_base32 ( secret : & str ) -> Self {
110
+ TOTP :: default_from_base32_with_digest ( secret, MacDigest :: SHA1 )
111
111
}
112
112
113
113
/// Creates a new TOTP instance with a base32 representation of the secret and
@@ -117,7 +117,7 @@ impl TOTP {
117
117
///
118
118
/// # Panics
119
119
/// This method panics if the provided string is not correctly base32 encoded.
120
- pub fn from_base32_with_digest ( secret : & str , mac_digest : MacDigest ) -> Self {
120
+ pub fn default_from_base32_with_digest ( secret : & str , mac_digest : MacDigest ) -> Self {
121
121
TOTP :: new_from_base32 ( secret, mac_digest, 6 , 30 )
122
122
}
123
123
}
0 commit comments