@@ -19,7 +19,7 @@ pub struct TOTP {
1919 /// The secret key used in the HMAC process.
2020 ///
2121 /// Often given as a Base32 key, which can be conveniently initialized using
22- /// [`TOTP::from_base32 `] constructors.
22+ /// [`TOTP::default_from_base32 `] constructors.
2323 secret : Vec < u8 > ,
2424
2525 /// The digest to use in the HMAC process.
@@ -71,31 +71,31 @@ impl TOTP {
7171 ///
7272 /// Defaults to using [`MacDigest::SHA1`] as the digest for HMAC operations,
7373 /// 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 )
7676 }
7777
7878 /// Creates a new TOTP instance with a byte-array representation of the secret and
7979 /// a digest algorithm.
8080 ///
8181 /// 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 {
8383 TOTP :: new ( secret, mac_digest, 6 , 30 )
8484 }
8585
8686 /// Creates a new TOTP instance with an utf8 representation of the secret.
8787 ///
8888 /// Defaults to using [`MacDigest::SHA1`] as the digest for HMAC operations,
8989 /// 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 )
9292 }
9393
9494 /// Creates a new TOTP instance with an utf8 representation of the secret and
9595 /// a digest algorithm.
9696 ///
9797 /// 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 {
9999 TOTP :: new_from_utf8 ( secret, mac_digest, 6 , 30 )
100100 }
101101
@@ -106,8 +106,8 @@ impl TOTP {
106106 ///
107107 /// # Panics
108108 /// 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 )
111111 }
112112
113113 /// Creates a new TOTP instance with a base32 representation of the secret and
@@ -117,7 +117,7 @@ impl TOTP {
117117 ///
118118 /// # Panics
119119 /// 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 {
121121 TOTP :: new_from_base32 ( secret, mac_digest, 6 , 30 )
122122 }
123123}
0 commit comments