mirror of
https://forgejo.ellis.link/continuwuation/continuwuity/
synced 2026-07-04 23:21:37 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 317eabc4eb |
Generated
+7
@@ -1123,6 +1123,7 @@ dependencies = [
|
||||
"ctor",
|
||||
"cyborgtime",
|
||||
"either",
|
||||
"fastrand",
|
||||
"figment",
|
||||
"futures",
|
||||
"hardened_malloc-rs",
|
||||
@@ -1921,6 +1922,12 @@ dependencies = [
|
||||
"zune-inflate",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fastrand"
|
||||
version = "2.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
|
||||
|
||||
[[package]]
|
||||
name = "fax"
|
||||
version = "0.2.6"
|
||||
|
||||
@@ -70,6 +70,10 @@ version = "0.1.3"
|
||||
[workspace.dependencies.rand]
|
||||
version = "0.8.5"
|
||||
|
||||
# used for stamps
|
||||
[workspace.dependencies.fastrand]
|
||||
version = "2.3.0"
|
||||
|
||||
# Used for the http request / response body type for Ruma endpoints used with reqwest
|
||||
[workspace.dependencies.bytes]
|
||||
version = "1.10.1"
|
||||
|
||||
@@ -71,6 +71,7 @@ core_affinity.workspace = true
|
||||
ctor.workspace = true
|
||||
cyborgtime.workspace = true
|
||||
either.workspace = true
|
||||
fastrand.workspace = true
|
||||
figment.workspace = true
|
||||
futures.workspace = true
|
||||
http-body-util.workspace = true
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
pub const ARBIT_LENGTH: usize = 32;
|
||||
/// An arbit is an opaque, random 32-byte identifier.
|
||||
/// They are useful as unique, unordered database keys with no particular
|
||||
/// semantics except uniqueness.
|
||||
pub type Arbit = [u8; ARBIT_LENGTH];
|
||||
|
||||
#[must_use]
|
||||
#[inline]
|
||||
pub fn arbit() -> Arbit {
|
||||
let mut arbit = [0; ARBIT_LENGTH];
|
||||
fastrand::fill(&mut arbit);
|
||||
arbit
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
pub mod arbit;
|
||||
pub mod arrayvec;
|
||||
pub mod bool;
|
||||
pub mod bytes;
|
||||
|
||||
Reference in New Issue
Block a user