Companion

object Companion

Properties

Link copied to clipboard
const val SHA1_SIZE: Int = 20
Link copied to clipboard
const val SHA256_SIZE: Int = 32

Functions

Link copied to clipboard

Parse a hex string (40 chars → SHA-1, 64 → SHA-256).

Link copied to clipboard
fun max(sizeBytes: Int): Digest32

An all-ones (maximum) digest of sizeBytes bytes.

Link copied to clipboard
fun of(bytes: ByteArray, offset: Int = 0, length: Int = bytes.size - offset): Digest32

Wrap a copy of bytes. Length must be a multiple of 4 (like digest32).

Link copied to clipboard
fun sha1(bytes: ByteArray): Digest32

A 20-byte (SHA-1 sized) digest from raw bytes.

Link copied to clipboard

A 32-byte (SHA-256 sized) digest from raw bytes.

Link copied to clipboard
fun zeros(sizeBytes: Int): Digest32

An all-zero digest of sizeBytes bytes.