int load_table(const gcstring& table) { const size_t bufsize = 8000; char buf[bufsize]; IstreamFile fin((table + ".su").str(), "rb"); if (!fin) except("can't open " << table << ".su"); fin.getline(buf, bufsize); if (!has_prefix(buf, "Suneido dump 1")) except("invalid file"); char* buf2 = buf + table.size() + 1; fin.getline(buf2, bufsize); verify(0 == memcmp(buf2, "======", 6)); memcpy(buf, "create ", 7); memcpy(buf + 7, table.ptr(), table.size()); Loading loading; int n = load1(fin, buf); verify(!alerts); return n; }
void Md5::update(gcstring s) { if (! CryptHashData(hHash, (BYTE*) s.ptr(), s.size(), 0)) except("Md5: CryptHashData failed"); }
void SuAdler32::update(const gcstring& s) { value = checksum(value, s.ptr(), s.size()); }