-
Notifications
You must be signed in to change notification settings - Fork 1
Relax mp3 detection algorithm #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e48dd25 to
5a4dce8
Compare
wojcikstefan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though I haven't tested it.
filevalidator.js
Outdated
| [0x49, 0x44, 0x33] | ||
| [0x49, 0x44, 0x33], | ||
| // Other MP3 files (FF Fx and FF Ex – they may cause false-positives) | ||
| // Headers got from https://www.garykessler.net/library/file_sigs.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taken from
| "version": "1.0.1", | ||
| "description": "File signature validation in JavaScript", | ||
| "main": "filevalidator.js", | ||
| "scripts": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this unnecessary? I don't see any tests added to the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wojcikstefan I think his point is "why was it necessary"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is added by npm init and it's unnecessary. It was just a clean up.
| // Other MP3 files (FF Fx and FF Ex – they may cause false-positives) | ||
| // Headers got from https://www.garykessler.net/library/file_sigs.html | ||
| [0xFF, 0xE0], [0xFF, 0xE1], [0xFF, 0xE2], [0xFF, 0xE3], [0xFF, 0xE4], | ||
| [0xFF, 0xE5], [0xFF, 0xE6], [0xFF, 0xE7], [0xFF, 0xE8], [0xFF, 0xE9], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't x in the external site referring to a hex number? So e.g. 0xEA - 0xEF are missing still ? Or am I thinking about this wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, you're right, good point! Let me fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
0a20cb1 to
de6b891
Compare
Refs https://github.com/closeio/closeio/issues/8302.