MCPcopy Create free account
hub / github.com/brichard19/BitCrack / parseKeyspace

Function parseKeyspace

KeyFinder/main.cpp:162–188  ·  view source on GitHub ↗

* Parses the start:end key pair. Possible values are: start start:end start:+offset :end :+offset */

Source from the content-addressed store, hash-verified

160 :+offset
161 */
162bool parseKeyspace(const std::string &s, secp256k1::uint256 &start, secp256k1::uint256 &end)
163{
164 size_t pos = s.find(':');
165
166 if(pos == std::string::npos) {
167 start = secp256k1::uint256(s);
168 end = secp256k1::N - 1;
169 } else {
170 std::string left = s.substr(0, pos);
171
172 if(left.length() == 0) {
173 start = secp256k1::uint256(1);
174 } else {
175 start = secp256k1::uint256(left);
176 }
177
178 std::string right = s.substr(pos + 1);
179
180 if(right[0] == '+') {
181 end = start + secp256k1::uint256(right.substr(1));
182 } else {
183 end = secp256k1::uint256(right);
184 }
185 }
186
187 return true;
188}
189
190void usage()
191{

Callers 1

mainFunction · 0.85

Calls 1

uint256Class · 0.85

Tested by

no test coverage detected