Operation Sort: added value Length to option Order

This commit is contained in:
Didier Stevens 2022-10-30 15:33:11 +01:00
parent ed8bd34915
commit cb023089bb
2 changed files with 16 additions and 2 deletions

View file

@ -103,3 +103,15 @@ export function hexadecimalSort(a, b) {
return a.localeCompare(b);
}
/**
* Comparison operation for sorting of lines by length
*
* @param {string} a
* @param {string} b
* @returns {number}
*/
export function lengthSort(a, b) {
return a.length - b.length;
}