mirror of
https://github.com/nasrlol/torque.git
synced 2025-11-27 23:09:21 +01:00
feature: implemented hashing loop
- cleaned up useless ALU.scala file - will not be passing threads as parameters
This commit is contained in:
parent
94e2465ded
commit
b3a5e3305a
@ -13,7 +13,7 @@ object Torque {
|
|||||||
val now: Instant = Instant.now()
|
val now: Instant = Instant.now()
|
||||||
println(now)
|
println(now)
|
||||||
|
|
||||||
val pr = new Prime(4)
|
val pr = new Prime()
|
||||||
|
|
||||||
val intMax = 2147483647
|
val intMax = 2147483647
|
||||||
pr.run(intMax)
|
pr.run(intMax)
|
||||||
|
|||||||
@ -1,6 +0,0 @@
|
|||||||
package com.nsrddyn
|
|
||||||
|
|
||||||
class ALU {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -3,11 +3,29 @@ package com.nsrddyn
|
|||||||
import scala.util.hashing
|
import scala.util.hashing
|
||||||
|
|
||||||
class Hash {
|
class Hash {
|
||||||
|
|
||||||
def hashString(): Unit = {
|
|
||||||
|
|
||||||
println("Hello from hash function")
|
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package com.nsrddyn
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Prime(threads: Int) {
|
class Prime() {
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user