All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dererXII.scalashogi_2.13.5.0.2.source-code.Hash.scala Maven / Gradle / Ivy

There is a newer version: 12.1.1
Show newest version
package shogi

import java.security.MessageDigest

object Hash {

  val size = 3

  private def apply(str: String): PositionHash =
    MessageDigest getInstance "MD5" digest (str getBytes "UTF-8") take size

  def apply(sit: Situation): PositionHash = apply(sit.toSfen.value)

  def debug(hashes: PositionHash) = hashes.map(_.toInt).sum.toString

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy