mirror of
https://github.com/girlbossceo/ruwuma.git
synced 2025-04-29 06:49:48 -04:00
identifiers: Generate 10 chars long DeviceId by default
This is the length that is usually used in homeserver implementations, and this is the minimal length accepted by MAS.
This commit is contained in:
parent
cd133c2c15
commit
4f5cda56b7
2 changed files with 6 additions and 3 deletions
|
@ -37,6 +37,9 @@ Improvements:
|
|||
- The `unstable-unspecified` cargo feature was removed.
|
||||
- `Signatures` implements `IntoIterator`.
|
||||
- Implement `PartialEqAsRefStr`, `Eq`, `PartialOrdAsRefStr`, `OrdAsRefStr` for `ruma_common::media::Method`.
|
||||
- Add `AnyKeyName` as a helper type to use `KeyId` APIs without validating the
|
||||
key name.
|
||||
- `DeviceId::new()` generates a string with 10 chars instead of 8.
|
||||
|
||||
# 0.15.1
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ use super::{IdParseError, KeyName};
|
|||
///
|
||||
/// # #[cfg(feature = "rand")] {
|
||||
/// let random_id = DeviceId::new();
|
||||
/// assert_eq!(random_id.as_str().len(), 8);
|
||||
/// assert_eq!(random_id.as_str().len(), 10);
|
||||
/// # }
|
||||
///
|
||||
/// let static_id = device_id!("01234567");
|
||||
|
@ -37,7 +37,7 @@ impl DeviceId {
|
|||
#[cfg(feature = "rand")]
|
||||
#[allow(clippy::new_ret_no_self)]
|
||||
pub fn new() -> OwnedDeviceId {
|
||||
Self::from_borrowed(&generate_localpart(8)).to_owned()
|
||||
Self::from_borrowed(&generate_localpart(10)).to_owned()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ mod tests {
|
|||
#[cfg(feature = "rand")]
|
||||
#[test]
|
||||
fn generate_device_id() {
|
||||
assert_eq!(DeviceId::new().as_str().len(), 8);
|
||||
assert_eq!(DeviceId::new().as_str().len(), 10);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Reference in a new issue