pub fn ai_hash_decode_unchecked(s: &str) -> Result<Vec<u8>, AiHashError> {
    if &s[..1] != "u" {
        return Err(AiHashError::NoU);
    }
    let s = match base64::decode_config(&s[1..], base64::URL_SAFE_NO_PAD) {
        Err(_) => return Err(AiHashError::BadBase64),
        Ok(s) => s,
    };
    if s.len() != AI_HASH_FULL_LEN {
        return Err(AiHashError::BadSize);
    }
    let loc_bytes = ai_sgd_location_bytes(
        &s[AI_HASH_PREFIX_LEN..AI_HASH_PREFIX_LEN + AI_HASH_CORE_LEN],
    );
    let loc_bytes: &[u8] = &loc_bytes;
    if loc_bytes != &s[AI_HASH_PREFIX_LEN + AI_HASH_CORE_LEN..] {
        return Err(AiHashError::BadChecksum);
    }
    assert_length!(AI_HASH_FULL_LEN, &s);
    Ok(s.to_vec())
}
/// internal PARSE for ai hash REPR
internal PARSE for ai hash REPR
internal PARSE for ai hash REPR
pub fn ai_hash_decode_unchecked(s: &str) -> Result<Vec<u8>, AiHashError> {
    if &s[..1] != "u" {
        return Err(AiHashError::NoU);
    }
    let s = match base64::decode_config(&s[1..], base64::URL_SAFE_NO_PAD) {
        Err(_) => return Err(AiHashError::BadBase64),
        Ok(s) => s,
    };
    if s.len() != AI_HASH_FULL_LEN {
        return Err(AiHashError::BadSize);
    }
    let loc_bytes = ai_sgd_location_bytes(
        &s[AI_HASH_PREFIX_LEN..AI_HASH_PREFIX_LEN + AI_HASH_CORE_LEN],
    );
    let loc_bytes: &[u8] = &loc_bytes;
    if loc_bytes != &s[AI_HASH_PREFIX_LEN + AI_HASH_CORE_LEN..] {
        return Err(AiHashError::BadChecksum);
    }
    assert_length!(AI_HASH_FULL_LEN, &s);
    Ok(s.to_vec())
}
pub fn ai_hash_decode_unchecked ( s : & str ) -> Result < Vec < u8 > , AiHashError > { if & s [ .. 1 ] != " " { return Err ( AiHashError :: NoU ) ; } let s = match base64 :: decode_config ( & s [ 1 .. ] , base64 :: URL_SAFE_NO_PAD ) { Err ( _ ) => return Err ( AiHashError :: BadBase64 ) , Ok ( s ) => s , } ; if s . len ( ) != AI_HASH_FULL_LEN { return Err ( AiHashError :: BadSize ) ; } let loc_bytes = ai_sgd_location_bytes ( & s [ AI_HASH_PREFIX_LEN .. AI_HASH_PREFIX_LEN + AI_HASH_CORE_LEN ] , ) ; let loc_bytes : & [ u8 ] = & loc_bytes ; if loc_bytes != & s [ AI_HASH_PREFIX_LEN + AI_HASH_CORE_LEN .. ] { return Err ( AiHashError :: BadChecksum ) ; } assert_length ! ( AI_HASH_FULL_LEN s ) ; Ok ( s . to_vec ( ) ) }
internal PARSE for ai hash REPR
internal PARSE for ai hash REPR
s
&str
s
&str