Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kgrz/filemagick-signatures
This repo holds the magic number signatures for all documented file types
https://github.com/kgrz/filemagick-signatures
Last synced: about 2 months ago
JSON representation
This repo holds the magic number signatures for all documented file types
- Host: GitHub
- URL: https://github.com/kgrz/filemagick-signatures
- Owner: kgrz
- License: mit
- Created: 2014-10-18T08:43:49.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-19T20:05:48.000Z (over 10 years ago)
- Last Synced: 2024-04-24T03:00:49.349Z (9 months ago)
- Language: Ruby
- Size: 148 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Filemagick::Signatures
This module contains the signatures for use
either independently or via the `filemagick` library. The various file
signatures currently supported are taken from [Gary Kessler's
website][2]The signatures are stored in a YAML file in the following format:
```yaml
- mime: 'application/pdf'
extensions:
- 'pdf'
signatures:
starting:
offset: 0
hexcodes:
- '25504446'
trailing:
offset: 0
hexcodes:
- '0a2525454f46'
- '0a2525454f460a'
- '0d0a2525454f460d0a'
- '0d2525454f460d'
```* The files typically have a `starting` and a `trailing` signatures.
* The `offset` part is the number of bytes to ignore from the beginning
in the case of starting signature and from the end in case of trailing
signature. This will be a number.
* `hexcodes` key holds a list of possible signatures. The validation
logic takes into account all the signatures and it will be a `true`
case if the file has any one of the specified signatures.If a new signature has to be added, then the details have to be
specified in the same manner.[2]: http://www.garykessler.net/library/file_sigs.html
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'filemagick-signatures'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install filemagick-signatures
## Usage
## Contributing
1. Fork it ( https://github.com/[my-github-username]/filemagick-signatures/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request