MCPcopy Index your code
hub / github.com/TheAlgorithms/JavaScript / binLookup

Function binLookup

Conversions/HexToBinary.js:1–19  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

1const binLookup = (key) =>
2 ({
3 0: '0000',
4 1: '0001',
5 2: '0010',
6 3: '0011',
7 4: '0100',
8 5: '0101',
9 6: '0110',
10 7: '0111',
11 8: '1000',
12 9: '1001',
13 a: '1010',
14 b: '1011',
15 c: '1100',
16 d: '1101',
17 e: '1110',
18 f: '1111'
19 })[key.toLowerCase()] // select the binary number by valid hex key with the help javascript object
20
21const hexToBinary = (hexString) => {
22 if (typeof hexString !== 'string') {

Callers 1

hexToBinaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected