| 106 | } |
| 107 | |
| 108 | void encodeB64_3Bytes(unsigned char *in3Bytes, unsigned char *out4Bytes) { |
| 109 | if (in3Bytes == NULL || out4Bytes == NULL) { |
| 110 | return; |
| 111 | } |
| 112 | |
| 113 | out4Bytes[0] = EncodeB64_Mul4Byte[in3Bytes[0]]; |
| 114 | out4Bytes[1] = EncodeB64_LoopByte[((in3Bytes[0] & 0x03) << 4) + ((in3Bytes[1] & 0xf0) >> 4)]; |
| 115 | out4Bytes[2] = EncodeB64_LoopByte[((in3Bytes[1] & 0x0f) << 2) + ((in3Bytes[2] & 0xc0) >> 6)]; |
| 116 | out4Bytes[3] = EncodeB64_LoopByte[in3Bytes[2]]; |
| 117 | } |
| 118 | |
| 119 | // =========================== |
| 120 | // |