summaryrefslogtreecommitdiff
path: root/src/main/scala/com/nsrddyn/ALU/Hash.scala
diff options
context:
space:
mode:
authornasr <nsrddyn@gmail.com>2025-11-20 21:43:16 +0100
committernasr <nsrddyn@gmail.com>2025-11-20 21:43:16 +0100
commit409b76a88e589cbd7a8dfd9d0aad8152bb00d0bb (patch)
tree6c6648a8bc025901e57de36174068ebd5e4a5523 /src/main/scala/com/nsrddyn/ALU/Hash.scala
parente077e179d43e04c7365acf8d1cc5bcb55998e6bd (diff)
feature: implemented some basic benchmarking logic & enum for pass and test
Diffstat (limited to 'src/main/scala/com/nsrddyn/ALU/Hash.scala')
-rw-r--r--src/main/scala/com/nsrddyn/ALU/Hash.scala31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main/scala/com/nsrddyn/ALU/Hash.scala b/src/main/scala/com/nsrddyn/ALU/Hash.scala
new file mode 100644
index 0000000..9dc5a98
--- /dev/null
+++ b/src/main/scala/com/nsrddyn/ALU/Hash.scala
@@ -0,0 +1,31 @@
+package com.nsrddyn.alu
+
+import scala.util.hashing
+
+class Hash {
+
+import scala.util.hashing.MurmurHash3
+
+ def run(word: String, loopSize: Int): Unit = {
+
+ /* TODO: implement ALU friendly, so high speed hashing
+ * to continuously loop over voor stressing
+ * ALU
+ *
+ * While looking for hashing algorithmes to implement I stumbled on:
+ * https://scala-lang.org/api/3.x/scala/util/hashing/MurmurHash3$.html
+ *
+ * which is an implemntation of **smasher** http://github.com/aappleby/smhasher
+ * the exact type of hashing algorithm I was looking for
+ *
+ * In the scala description they state: "This algorithm is designed to generate
+ * well-distributed non-cryptographic hashes. It is designed to hash data in 32 bit chunks (ints). "
+ *
+ * (ints) -> ALU
+ *
+ */
+
+ for i <- 0 to loopSize do MurmurHash3.stringHash(word)
+
+ }
+}