A simple library for validating & checking file types. Written in V
# example/type_check.v
import filecheck
fn main() {
path := "./data/sctest"
ans := filecheck.which_type(path) or {
println(err)
return
}
println('We are dealing with $ans type of file here!')
}
Some more examples are available in examples directory
- Star this repository
- Fork this repository
- Add magic numbers to the const.v file
- Write match function in match.v file
- Write wrapper function in filecheck.v file
- Commit your changes
- Send a PR
- To find out header and footer values of other file types please look into this repo
- You may also contribute to that repository to help others find file types
>>> some_hex_array = [0x57, 0x45, 0x42, 0x50]
>>> some_hex_array
[87, 69, 66, 80]