This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdint> | |
#include <vector> | |
#include <array> | |
#include <openssl/evp.h> | |
#include <openssl/sha.h> | |
namespace { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdint> | |
#include <string> | |
#include <vector> | |
#include <openssl/evp.h> | |
namespace { | |
bool DecodeBase64(std::vector<uint8_t> & out, const std::string & in) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdint> | |
#include <string> | |
#include <vector> | |
#include <openssl/evp.h> | |
#include <openssl/buffer.h> | |
namespace { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdint> | |
#include <string> | |
#include <vector> | |
#include <iostream> | |
#include <fstream> | |
#include <cassert> | |
#include <curl/curl.h> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template < | |
typename T, | |
typename V = typename std::decay_t<T>::value_type, | |
typename = std::enable_if_t< | |
std::is_base_of<std::basic_string<V>, std::decay_t<T> >::value | |
> | |
> | |
auto GetStringByteSize(const T & str) noexcept | |
{ | |
// ignore null char |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
https://developer.apple.com/library/ios/documentation/GameKit/Reference/GKLocalPlayer_Ref/index.html#//apple_ref/occ/instm/GKLocalPlayer/generateIdentityVerificationSignatureWithCompletionHandler: | |
*/ | |
//////////////////////////////////////////////////////////////////////////////// | |
void GetVerifiedData( | |
std::array<uint8_t, SHA256_DIGEST_LENGTH> & verifiedData, | |
const std::string & playerId, | |
const std::string & bundleId, | |
int64_t timestamp, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from Effective Modern C++ | |
template <typename T, std::size_t N> | |
constexpr std::size_t arrSize(T (&) [N]) noexcept | |
{ | |
return N; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for C++14 | |
template <typename E> | |
constexpr auto ToUType(E arg) noexcept | |
{ | |
return static_cast<std::underlying_type_t<E>>(arg); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// utf8.cpp | |
// | |
// Created by Jinho Bak on 9/30/16. | |
// Copyright (c) 2016 Jinho Bak. All rights reserved. | |
// | |
#include <vector> | |
#include <string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::vector<std::string> Tokenize (const std::string & str, char delim) { | |
if (str.empty() || !delim) { | |
return {}; | |
} | |
std::vector<std::string> out; | |
std::string token; | |
std::stringstream ss(str); | |
while (std::getline(ss, token, delim)) { |
OlderNewer