MCPcopy Create free account
hub / github.com/albertobsd/keyhunt / SetBaseN

Method SetBaseN

secp256k1/Int.cpp:995–1013  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

993// ------------------------------------------------
994
995void Int::SetBaseN(int n,const char *charset,const char *value) {
996 CLEAR();
997 Int pw((uint64_t)1);
998 Int nb((uint64_t)n);
999 Int c;
1000 int lgth = (int)strlen(value);
1001 for(int i=lgth-1;i>=0;i--) {
1002 char *p = strchr((char*)charset,toupper(value[i]));
1003 if(!p) {
1004 printf("Invalid charset !!\n");
1005 return;
1006 }
1007 int id = (int)(p-charset);
1008 c.SetInt32(id);
1009 c.Mult(&pw);
1010 Add(&c);
1011 pw.Mult(&nb);
1012 }
1013}
1014
1015// ------------------------------------------------
1016

Callers

nothing calls this directly

Calls 2

SetInt32Method · 0.45
MultMethod · 0.45

Tested by

no test coverage detected