case kMD5_ChecksumType: {
for (int i = 0; i < loops; i++) {
SkMD5 md5;
- md5.update(reinterpret_cast<uint8_t*>(fData), sizeof(fData));
+ md5.write(fData, sizeof(fData));
SkMD5::Digest digest;
md5.finish(digest);
}
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
- this->update(PADDING, paddingLength);
+ (void)this->write(PADDING, paddingLength);
// Append length (length before padding, will cause final update).
- this->update(bits, 8);
+ (void)this->write(bits, 8);
// Write out digest.
encode(digest.data, this->state);
size_t bytesWritten() const final { return SkToSizeT(this->byteCount); }
- /** Alias for write() */
- void update(const uint8_t* b, size_t l) { (void)this->write(b, l); }
-
struct Digest {
uint8_t data[16];
bool operator ==(Digest const& other) const {
SkMD5 md5;
size_t rowLen = bm.info().bytesPerPixel() * bm.width();
for (int y = 0; y < bm.height(); ++y) {
- md5.update(static_cast<uint8_t*>(bm.getAddr(0, y)), rowLen);
+ md5.write(bm.getAddr(0, y), rowLen);
}
md5.finish(*digest);
}
// All at once
{
SkMD5 context;
- context.update(reinterpret_cast<const uint8_t*>(string), len);
+ context.write(string, len);
SkMD5::Digest digest;
context.finish(digest);
const uint8_t* data = reinterpret_cast<const uint8_t*>(string);
const uint8_t* end = reinterpret_cast<const uint8_t*>(string + len);
for (; data < end; ++data) {
- context.update(data, 1);
+ context.write(data, 1);
}
SkMD5::Digest digest;
context.finish(digest);
SkMD5 md5;
size_t rowLen = bm.info().bytesPerPixel() * bm.width();
for (int y = 0; y < bm.height(); ++y) {
- md5.update(static_cast<uint8_t*>(bm.getAddr(0, y)), rowLen);
+ md5.write(bm.getAddr(0, y), rowLen);
}
md5.finish(*digest);
}