Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.zookeeper.server;

import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.zip.CRC32;
import org.apache.zookeeper.ZooDefs;
import org.apache.zookeeper.data.StatPersisted;
Expand All @@ -30,7 +31,7 @@ public class DigestCalculator {

// The hardcoded digest version, should bump up this version whenever
// we changed the digest method or fields.
private static final int DIGEST_VERSION = 2;
private static final int DIGEST_VERSION = 3;


/**
Expand Down Expand Up @@ -95,7 +96,7 @@ long calculateDigest(String path, byte[] data, StatPersisted stat) {
bb.putLong(stat.getEphemeralOwner());

CRC32 crc = new CRC32();
crc.update(path.getBytes());
crc.update(path.getBytes(StandardCharsets.UTF_8));
if (data != null) {
crc.update(data);
}
Expand Down