| 346 | namespace Firebird { |
| 347 | |
| 348 | void Sha1::hashBased64(string& hash, const string& data) |
| 349 | { |
| 350 | SHA_INFO si; |
| 351 | sha_init(&si); |
| 352 | sha_update(&si, reinterpret_cast<const unsigned char*>(data.c_str()), data.length()); |
| 353 | UCharBuffer b; |
| 354 | sha_final(b.getBuffer(SHA_DIGESTSIZE), &si); |
| 355 | fb_utils::base64(hash, b); |
| 356 | } |
| 357 | |
| 358 | Sha1::Sha1() |
| 359 | : active(false) |