We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60227d7 commit 1a9843dCopy full SHA for 1a9843d
ch07-graph/src/main/scala/com/cloudera/datascience/graph/RunGraph.scala
@@ -197,6 +197,9 @@ object RunGraph extends Serializable {
197
}
198
199
def hashId(str: String): Long = {
200
+ // This is effectively the same implementation as in Guava's Hashing, but 'inlined'
201
+ // to avoid a dependency on Guava just for this. It creates a long from the first 8 bytes
202
+ // of the (16 byte) MD5 hash, with first byte as least-significant byte in the long.
203
val bytes = MessageDigest.getInstance("MD5").digest(str.getBytes(StandardCharsets.UTF_8))
204
(bytes(0) & 0xFFL) |
205
((bytes(1) & 0xFFL) << 8) |
0 commit comments