资源简介
比特币量化高频交易源码程序,是一个量化交易的例子,非常好的参考价值,让你开启躺着收钱模式。
代码片段和文件信息
/*
base64.cpp and base64.h
Copyright (C) 2004-2008 René Nyffenegger
This source code is provided ‘as-is‘ without any express or implied
warranty. In no event will the author be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose
including commercial applications and to alter it and redistribute it
freely subject to the following restrictions:
1. The origin of this source code must not be misrepresented; you must not
claim that you wrote the original source code. If you use this source code
in a product an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such and must not be
misrepresented as being the original source code.
3. This notice may not be removed or altered from any source distribution.
René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/
#include “base64.h“
#include
static const std::string base64_chars =
“ABCDEFGHIJKLMNOPQRSTUVWXYZ“
“abcdefghijklmnopqrstuvwxyz“
“0123456789+/“;
static inline bool is_base64(unsigned char c) {
return (isalnum(c) || (c == ‘+‘) || (c == ‘/‘));
}
std::string base64_encode(unsigned char const* bytes_to_encode unsigned int in_len) {
std::string ret;
int i = 0;
int j = 0;
unsigned char char_array_3[3];
unsigned char char_array_4[4];
while (in_len--) {
char_array_3[i++] = *(bytes_to_encode++);
if (i == 3) {
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
char_array_4[3] = char_array_3[2] & 0x3f;
for (i = 0; (i <4); i++)
ret += base64_chars[char_array_4[i]];
i = 0;
}
}
if (i)
{
for (j = i; j < 3; j++)
char_array_3[j] = ‘\0‘;
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
char_array_4[3] = char_array_3[2] & 0x3f;
for (j = 0; (j < i + 1); j++)
ret += base64_chars[char_array_4[j]];
while ((i++ < 3))
ret += ‘=‘;
}
return ret;
}
std::string base64_decode(std::string const& encoded_string) {
int in_len = encoded_string.size();
int i = 0;
int j = 0;
int in_ = 0;
unsigned char char_array_4[4] char_array_3[3];
std::string ret;
while (in_len-- && (encoded_string[in_] != ‘=‘) && is_base64(encoded_string[in_])) {
char_array_4[i++] = encoded_string[in_]; in_++;
if (i == 4) {
for (i = 0; i <4; i++)
char_array_4[i] = base64_chars.find(char_array_4[i]);
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
for (i = 0; (
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-09-11 06:00 btcchina-api-cpp-master\
文件 2939 2014-09-11 06:00 btcchina-api-cpp-master\.gitignore
目录 0 2014-09-11 06:00 btcchina-api-cpp-master\api_by_http\
文件 11226 2014-09-11 06:00 btcchina-api-cpp-master\api_by_http\BTCChinaAPI.cpp
文件 2425 2014-09-11 06:00 btcchina-api-cpp-master\api_by_http\BTCChinaAPI.h
文件 1531 2014-09-11 06:00 btcchina-api-cpp-master\api_by_http\HMAC_SHA1.cpp
文件 1017 2014-09-11 06:00 btcchina-api-cpp-master\api_by_http\HMAC_SHA1.h
文件 6109 2014-09-11 06:00 btcchina-api-cpp-master\api_by_http\README.md
文件 7307 2014-09-11 06:00 btcchina-api-cpp-master\api_by_http\SHA1.cpp
文件 3645 2014-09-11 06:00 btcchina-api-cpp-master\api_by_http\SHA1.h
文件 3513 2014-09-11 06:00 btcchina-api-cpp-master\api_by_http\ba
文件 134 2014-09-11 06:00 btcchina-api-cpp-master\api_by_http\ba
文件 796 2014-09-11 06:00 btcchina-api-cpp-master\api_by_http\cpp-wrapper.cpp
文件 973 2014-09-11 06:00 btcchina-api-cpp-master\api_by_http\cpp-wrapper.sln
文件 4748 2014-09-11 06:00 btcchina-api-cpp-master\api_by_http\cpp-wrapper.vcxproj
文件 1849 2014-09-11 06:00 btcchina-api-cpp-master\api_by_http\cpp-wrapper.vcxproj.filters
文件 308 2014-09-11 06:00 btcchina-api-cpp-master\api_by_http\makefile
目录 0 2014-09-11 06:00 btcchina-api-cpp-master\api_by_socketio\
文件 13 2014-09-11 06:00 btcchina-api-cpp-master\api_by_socketio\.gitignore
文件 1345 2014-09-11 06:00 btcchina-api-cpp-master\api_by_socketio\README.md
文件 225 2014-09-11 06:00 btcchina-api-cpp-master\api_by_socketio\sample.cpp
文件 5888 2014-09-11 06:00 btcchina-api-cpp-master\api_by_socketio\socketio.cpp
文件 1470 2014-09-11 06:00 btcchina-api-cpp-master\api_by_socketio\socketio.hpp
相关资源
- 招商策略_抱团启示录那些年我们一起
- 基于Win10和VS2013-VS2019的比特币源码(
- 精通比特币——区块链
- Trading Systems A new approach to system devel
- 以太坊最新源码 go语言版
- 精通比特币中文版pdf
- 《精通比特币》中文高清完整.pdf版
- Algorithmic Trading Winning Strategies and The
- 精通比特币.rar
- High Frequency Financial Econometrics
- 13个经典量化策略 汇总.pdf
- 比特币bitcoin源代码
- Pairs Trading - Quantitative Methods and Analy
- Successful Algorithmic Trading原书加代码
- 精通比特币第二版-超清.pdf
- 比特币与区块链原理解析
- 比特币白皮书中文版
- 精通比特币.pdf
- 量化交易 如何建立自己的算法交易事
- 精通比特币(英文第2版带书签)Mas
- 量化交易资料
- Advanced Algorithmic Trading原书加代码
- 区块链 PPT 科普 学习 扫盲 原理 详解
- 火币交易所 ETH BTC交易对 分钟数据
- 精通比特币(精通BitCoin)第二版 中文
- 《精通比特币》第二版 mastering bitco
- 从零开始自己动手写区块链超高清.
- 比特币勒索病毒秒余额生成器源码
- 区块链-通往资产数字化之路
- 4个lstm做数据预测的案例源代码,包括
评论
共有 条评论