Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://www.zedwood.com/article/cpp-sha256-function
- vector<int> sha256genroll(string const &value, string const &seed, string const &lotto)
- {
- int str = std::stoi(value.substr(0, 6));
- int end = std::stoi(value.substr(7, 6));
- vector<int> int_list;
- int length = end - str;
- for( int i = 0; i <= length; i++ )
- {
- string msgh = seed + "-" + lotto + "-" + to_string(str + i);
- string hash = sha256(msgh).substr(0, 8);
- unsigned long x;
- stringstream ss;
- ss << hex << hash;
- ss >> x;
- x = x % 15;
- if( x > 0 && x < 8 )
- x = 1;
- else
- if( x > 7 && x < 15 )
- x = 2;
- int_list.push_back(x);
- }
- return int_list;
- }
Advertisement
Add Comment
Please, Sign In to add comment