feat(server): use better salt
This commit is contained in:
parent
5ec42b4432
commit
a4bf201ffa
|
@ -14,7 +14,7 @@ use axum::http::Method;
|
|||
use axum::response::{IntoResponse, Response};
|
||||
use axum::routing::{get, post};
|
||||
use bytes::Bytes;
|
||||
use rand::distributions::{Alphanumeric, DistString};
|
||||
use rand::Rng;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde::de::DeserializeOwned;
|
||||
use siphasher::sip::SipHasher;
|
||||
|
@ -64,7 +64,11 @@ async fn main() -> Result<()> {
|
|||
|
||||
let state = Arc::new(AppState {
|
||||
pool,
|
||||
salt: Alphanumeric.sample_string(&mut rand::thread_rng(), 8),
|
||||
salt: data_encoding::BASE64_NOPAD.encode(&{
|
||||
let mut bytes = [0; 16];
|
||||
rand::thread_rng().fill(&mut bytes);
|
||||
bytes
|
||||
}),
|
||||
hasher: SipHasher::new(),
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue