| 64 | int last = 0; |
| 65 | |
| 66 | int |
| 67 | unpack(string &packed, uint8_t *unpacked) |
| 68 | { |
| 69 | int n = packed.length() / 2; |
| 70 | for (int i = 0; i < n; ++i) { |
| 71 | int u = packed[i * 2]; |
| 72 | int l = packed[i * 2 + 1]; |
| 73 | unpacked[i] = (((u >= 'a') ? u - 'a' + 10 : u - '0') << 4) + ((l >= 'a') ? l - 'a' + 10 : l - '0'); |
| 74 | } |
| 75 | return n; |
| 76 | } |
| 77 | |
| 78 | void |
| 79 | pack(uint8_t *unpacked, int unpacked_len, string &packed) |
no test coverage detected