pub fn extension_is_blacklisted(ext: &OsStr) -> bool {
#[cfg(not(target_os = "windows"))] use std::os::unix::ffi::OsStrExt;
if !matches!(ext.len(),  1 | 2 | 3 | 4 | 5 | 7 | 8) { return false; }

let mut buf = [0u8; 8];
#[cfg(not(target_os = "windows"))]
let bytes = ext.as_bytes();
#[cfg(target_os = "windows")]
let bytes = ext.as_encoded_bytes();
for (i, b) in bytes.iter().enumerate() {
if !b.is_ascii_alphanumeric() {
    return false;
}
buf[i] = b.to_ascii_lowercase();
}
let lcase = &buf[0..ext.len()];

matches!(lcase,  b"z" | b"7z" | b"b1" | b"ba" | b"bh" | b"br" | b"dd" | b"gz" | b"ha" | b"lz" | b"qt" | b"ra" | b"rk" | b"rm" | b"rz" | b"sz" | b"uc" | b"wv" | b"xz" | b"zz" | b"3g2" | b"3gp" | b"aac" | b"aar" | b"aax" | b"ace" | b"afa" | b"alz" | b"amr" | b"amv" | b"ape" | b"apk" | b"arc" | b"arj" | b"ark" | b"asf" | b"avi" | b"awb" | b"b6z" | b"bpg" | b"bz2" | b"cab" | b"car" | b"cdx" | b"cfs" | b"cpt" | b"dar" | b"dct" | b"deb" | b"dgc" | b"dmg" | b"drc" | b"dss" | b"dvf" | b"ear" | b"f4a" | b"f4b" | b"f4p" | b"f4v" | b"flv" | b"gca" | b"gif" | b"gsm" | b"hki" | b"ice" | b"ivs" | b"jar" | b"jpg" | b"kgb" | b"lha" | b"lz4" | b"lzh" | b"lzo" | b"lzx" | b"m2v" | b"m4a" | b"m4b" | b"m4p" | b"m4v" | b"mkv" | b"mmf" | b"mng" | b"mov" | b"mp2" | b"mp3" | b"mp4" | b"mpc" | b"mpe" | b"mpg" | b"mpv" | b"msv" | b"mts" | b"mxf" | b"nsv" | b"oga" | b"ogg" | b"ogv" | b"pak" | b"pcx" | b"pea" | b"pim" | b"pit" | b"png" | b"qda" | b"rar" | b"roq" | b"s7z" | b"sda" | b"sea" | b"sen" | b"sfx" | b"shk" | b"sit" | b"sln" | b"sqx" | b"svi" | b"tgz" | b"tif" | b"tlz" | b"tta" | b"txz" | b"uc0" | b"uc2" | b"uca" | b"ucn" | b"ue2" | b"uha" | b"ur2" | b"viv" | b"vob" | b"vox" | b"war" | b"wim" | b"wma" | b"wmv" | b"xar" | b"xp3" | b"yuv" | b"yz1" | b"zip" | b"zoo" | b"zst" | b"avif" | b"flac" | b"gifv" | b"heic" | b"jfif" | b"jpeg" | b"lzma" | b"m2ts" | b"mogg" | b"mpeg" | b"opus" | b"paq6" | b"paq7" | b"paq8" | b"phar" | b"rmvb" | b"sitx" | b"tbz2" | b"tiff" | b"webm" | b"webp" | b"zipx" | b"zpaq" | b"avifs" | b"iklax" | b"sfark" | b"genozip" | b"partimg" | b"jpeg2000")
}
