unicode.hpp 261 B

1234567891011121314
  1. #pragma once
  2. unsigned char hexbyte(const char c);
  3. template<typename T>
  4. static T hexbyte(const char str[], unsigned int len)
  5. {
  6. T result = 0;
  7. for (unsigned int i =0; i < len; ++i)
  8. result = (result << 4) + hexbyte(str[i]);
  9. return result;
  10. }