1/** 2 * WP File Download 3 * 4 * @package WP File Download 5 * @author Joomunited 6 * @version 1.0 7 */ 8bytesToSize = function(bytes) { 9 var sizes = []; 10 11 if (typeof (window.wpfdHelper) !== 'undefined' && typeof (window.wpfdHelper.fileMeasure) !== 'undefined' && window.wpfdHelper.fileMeasure.length > 0) { 12 sizes = window.wpfdHelper.fileMeasure; 13 } else { 14 sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']; 15 } 16 17 if (bytes <= 0) return 'N/A'; 18 19 var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024))); 20 21 return (bytes / Math.pow(1024, i)).toFixed(2) + ' ' + sizes[i]; 22};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.