Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
/* jshint browser: true, devel: true */ | |
/** | |
* preg_replace (from PHP) in JavaScript! | |
* | |
* This is basically a pattern replace. You can use a regex pattern to search and | |
* another for the replace. For more information see the PHP docs on the original | |
* function (http://php.net/manual/en/function.preg-replace.php), and for more on | |
* JavaScript flavour regex visit http://www.regular-expressions.info/javascript.html | |
* |
Magic numbers are the first bits of a file which uniquely identify the type of file. This makes programming easier because complicated file structures need not be searched in order to identify the file type.
For example, a jpeg file starts with ffd8 ffe0 0010 4a46 4946 0001 0101 0047 ......JFIF.....G ffd8 shows that it's a JPEG file, and ffe0 identify a JFIF type structure. There is an ascii encoding of "JFIF" which comes after a length code, but that is not necessary in order to identify the file. The first 4 bytes do that uniquely.
This gives an ongoing list of file-type magic numbers.