1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.U8_TO_HEX = exports.U16_TO_HEX = exports.HEX_TO_U8 = exports.HEX_TO_U16 = void 0;
|
7 |
|
8 |
|
9 | const U8_TO_HEX = new Array(256);
|
10 | exports.U8_TO_HEX = U8_TO_HEX;
|
11 | const U16_TO_HEX = new Array(256 * 256);
|
12 | exports.U16_TO_HEX = U16_TO_HEX;
|
13 | const HEX_TO_U8 = {};
|
14 | exports.HEX_TO_U8 = HEX_TO_U8;
|
15 | const HEX_TO_U16 = {};
|
16 | exports.HEX_TO_U16 = HEX_TO_U16;
|
17 |
|
18 | for (let n = 0; n < 256; n++) {
|
19 | const hex = n.toString(16).padStart(2, '0');
|
20 | U8_TO_HEX[n] = hex;
|
21 | HEX_TO_U8[hex] = n;
|
22 | }
|
23 |
|
24 | for (let i = 0; i < 256; i++) {
|
25 | for (let j = 0; j < 256; j++) {
|
26 | const hex = U8_TO_HEX[i] + U8_TO_HEX[j];
|
27 | const n = i << 8 | j;
|
28 | U16_TO_HEX[n] = hex;
|
29 | HEX_TO_U16[hex] = n;
|
30 | }
|
31 | } |
\ | No newline at end of file |