Overview
Comment: | Fix a sign issue in base64. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
4d44bbf58615c50a80ba16dad1564337 |
User & Date: | js on 2011-02-19 20:30:09 |
Other Links: | manifest | tags |
Context
2011-02-24
| ||
18:27 | Make it possible to specify a TLS socket class for OFHTTPRequest. check-in: c64d88f50f user: js tags: trunk | |
2011-02-19
| ||
20:30 | Fix a sign issue in base64. check-in: 4d44bbf586 user: js tags: trunk | |
16:08 | Add -[elementsForName:namespace:] to OFXMLElement. check-in: 8732769f4c user: js tags: trunk | |
Changes
Modified src/base64.m from [e05586f6d2] to [fbdefb1528].
︙ | ︙ | |||
16 17 18 19 20 21 22 | #include "config.h" #import "OFString.h" #import "OFDataArray.h" #import "base64.h" | | | | > | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | #include "config.h" #import "OFString.h" #import "OFDataArray.h" #import "base64.h" const uint8_t of_base64_encode_table[64] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' }; const int8_t of_base64_decode_table[128] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, 0, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 }; OFString* of_base64_encode(const char *data, size_t len) { OFMutableString *ret = [OFMutableString string]; uint8_t *buf = (uint8_t*)data; size_t i; uint8_t rest; char tb[4]; uint32_t sb; rest = len % 3; |
︙ | ︙ |