Skip to content

Support hexadecimal in numeric sort#385

Merged
n1474335 merged 3 commits intogchq:masterfrom
qistoph:NumSortHex
Nov 7, 2018
Merged

Support hexadecimal in numeric sort#385
n1474335 merged 3 commits intogchq:masterfrom
qistoph:NumSortHex

Conversation

@qistoph
Copy link
Copy Markdown
Contributor

@qistoph qistoph commented Oct 11, 2018

This PR adds support for hexadecimal values to the sorting module.

Example input:

06
08
0a
0d
0f
1
10
11
12
13
14
15
16
17
18
19
1a
1b
1c
1d
1e
1f
2
3
4
5
7
9
b
c
e

Expected output:

1
2
3
4
5
06
7
08
9
0a
b
c
0d
e
0f
10
11
12
13
14
15
16
17
18
19
1a
1b
1c
1d
1e
1f

@qistoph qistoph changed the title Support hexadecimal and other bases in numeric sort Support hexadecimal in numeric sort Oct 11, 2018
@d98762625
Copy link
Copy Markdown
Member

Please could you add some unit tests to cover your new use cases?

Copy link
Copy Markdown
Member

@d98762625 d98762625 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR @qistoph . Just some minor changes around style. It would be great if you could add some test cases as well.

Comment thread src/core/operations/Sort.mjs Outdated
Comment thread src/core/operations/Sort.mjs
Comment thread src/core/operations/Sort.mjs Outdated
- Use Array.map instead of for-loop
- Add test case
@n1474335 n1474335 merged commit ba24e12 into gchq:master Nov 7, 2018
@n1474335
Copy link
Copy Markdown
Member

n1474335 commented Nov 7, 2018

Nice addition! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants