Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // hansi: hextable from
- // http://stackoverflow.com/questions/10324/how-can-i-convert-a-hexadecimal-number-to-base-10-efficiently-in-c
- static const long HEX2DEC[] = {
- [0 ... 255] = -1, // bit aligned access into this table is considerably
- ['0'] = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, // faster for most modern processors,
- ['A'] = 10, 11, 12, 13, 14, 15, // for the space conscious, reduce to
- ['a'] = 10, 11, 12, 13, 14, 15 // signed char.
- };
- // http://en.wikipedia.org/wiki/Percent-encoding#Types_of_URI_characters
- static bool SAFE[256] = {
- [0 ... 255] = false,
- ['a'...'z'] = true,
- ['A'...'Z'] = true,
- ['0'...'9'] = true,
- ['.'] = true
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement