Repository

valid

A simple library for validating & checking file types. Written in V

Example


# 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!')
}

Usage

Some more examples are available in examples directory

Contributing Guidelines

  1. Star this repository
  2. Fork this repository
  3. Add magic numbers to the const.v file
  4. Write match function in match.v file
  5. Write wrapper function in filecheck.v file
  6. Commit your changes
  7. Send a PR

Notes

  1. To find out header and footer values of other file types please look into this repo
  2. You may also contribute to that repository to help others find file types

Converting hex to decimal

>>> some_hex_array = [0x57, 0x45, 0x42, 0x50]
>>> some_hex_array
[87, 69, 66, 80]

About

0
74
1 year ago

Author

gaurav-gogia