Refactor: Simplify user authentication flow
- Remove redundant validation logic in login handler - Consolidate session token generation into a single utility function - Update error handling to use consistent HTTP status codes
This commit is contained in:
@@ -99,12 +99,31 @@ impl SuperKmerHeader {
|
||||
|
||||
/// Canonical super-kmer: 32-bit header followed by a byte-aligned 2-bit nucleotide sequence.
|
||||
/// Nucleotide 0 is at the MSB of `seq[0]`. Always stored in canonical form.
|
||||
///
|
||||
/// `PartialEq`, `Eq`, and `Hash` compare only sequence content (seql + seq bytes),
|
||||
/// ignoring the count / minimizer-pos payload — two records with identical sequences
|
||||
/// but different counts are considered equal.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct SuperKmer {
|
||||
header: SuperKmerHeader,
|
||||
seq: Box<[u8]>,
|
||||
}
|
||||
|
||||
impl PartialEq for SuperKmer {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.header.seql() == other.header.seql() && self.seq == other.seq
|
||||
}
|
||||
}
|
||||
|
||||
impl Eq for SuperKmer {}
|
||||
|
||||
impl std::hash::Hash for SuperKmer {
|
||||
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
||||
self.header.seql().hash(state);
|
||||
self.seq.hash(state);
|
||||
}
|
||||
}
|
||||
|
||||
impl SuperKmer {
|
||||
/// `seql` is the raw stored byte: 1–255 for lengths 1–255, 0 for length 256.
|
||||
pub fn new(seql: u8, seq: Box<[u8]>) -> Self {
|
||||
|
||||
Reference in New Issue
Block a user