it ain't much, but it's honest decoding

main
aprzn 2 years ago
parent 552219c457
commit ade6a200f6

@ -49,6 +49,14 @@ pub enum SongRequestError {
impl InnerLevel { impl InnerLevel {
pub fn try_from_encoded_ils(ils: &str) -> Option<Self> { pub fn try_from_encoded_ils(ils: &str) -> Option<Self> {
let b64 = URL_SAFE.decode(ils).ok()?;
let mut decoder = GzDecoder::<&[u8]>::new(b64.as_ref());
let mut ils = String::new();
decoder.read_to_string(&mut ils).ok()?;
Self::try_from_ils(&ils)
}
pub fn try_from_ils(ils: &str) -> Option<Self> {
todo!() todo!()
} }
} }

Loading…
Cancel
Save