Hash

sbt.io.Hash
object Hash

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Hash.type

Members list

Value members

Concrete methods

def apply(s: String): Array[Byte]

Calculates the SHA-1 hash of the given String.

Calculates the SHA-1 hash of the given String.

Attributes

def apply(as: Array[Byte]): Array[Byte]

Calculates the SHA-1 hash of the given Array[Byte].

Calculates the SHA-1 hash of the given Array[Byte].

Attributes

def apply(file: File): Array[Byte]

Calculates the SHA-1 hash of the given file.

Calculates the SHA-1 hash of the given file.

Attributes

def apply(url: URL): Array[Byte]

Calculates the SHA-1 hash of the given resource.

Calculates the SHA-1 hash of the given resource.

Attributes

def apply(stream: InputStream): Array[Byte]

Calculates the SHA-1 hash of the given stream, closing it when finished.

Calculates the SHA-1 hash of the given stream, closing it when finished.

Attributes

def contentsIfLocal(uri: URI): Array[Byte]

If the URI represents a local file (the scheme is "file"), this method calculates the SHA-1 hash of the contents of that file. Otherwise, this methods calculates the SHA-1 hash of the normalized string representation of the URI.

If the URI represents a local file (the scheme is "file"), this method calculates the SHA-1 hash of the contents of that file. Otherwise, this methods calculates the SHA-1 hash of the normalized string representation of the URI.

Attributes

def fromHex(hex: String): Array[Byte]

Converts the provided hexadecimal representation hex to an array of bytes. The hexadecimal representation must have an even number of characters in the range 0-9, a-f, or A-F.

Converts the provided hexadecimal representation hex to an array of bytes. The hexadecimal representation must have an even number of characters in the range 0-9, a-f, or A-F.

Attributes

def halfHashString(s: String): String

Computes the SHA-1 hash of s and truncates the hexadecimal representation of the hash via halve.

Computes the SHA-1 hash of s and truncates the hexadecimal representation of the hash via halve.

Attributes

def halve(s: String): String

Truncates the last half of s if the string has at least four characters. Otherwise, the original string is returned.

Truncates the last half of s if the string has at least four characters. Otherwise, the original string is returned.

Attributes

def toHex(bytes: Array[Byte]): String

Converts an array of bytes to a hexadecimal representation String.

Converts an array of bytes to a hexadecimal representation String.

Attributes

def trimHashString(s: String, i: Int): String

Computes the SHA-1 hash of s and returns the first i characters of the hexadecimal representation of the hash.

Computes the SHA-1 hash of s and returns the first i characters of the hexadecimal representation of the hash.

Attributes