On this page:
sha1
sha224
sha256
sha1_  bytes
sha224_  bytes
sha256_  bytes
0.45+9.1

13.6 Cryptographic Hashing🔗ℹ

 import: rhombus/crypto_hash package: rhombus-lib

function

fun crypto_hash.sha1(in :: Bytes || Port.Input) :: String

 

function

fun crypto_hash.sha224(in :: Bytes || Port.Input) :: String

 

function

fun crypto_hash.sha256(in :: Bytes || Port.Input) :: String

Computes the SHA-1, SHA-224, or SHA-256 hash of the content of in. The result is reported as a string of 2-digit hexadecimal numbers, one per byte in the computed hash.

> crypto_hash.sha1(#"apple")

"d0be2dc421be4fcd0172e5afceea3970e2f3d940"

function

fun crypto_hash.sha1_bytes(in :: Bytes || Port.Input) :: Bytes

 

function

fun crypto_hash.sha224_bytes(in :: Bytes || Port.Input) :: Bytes

 

function

fun crypto_hash.sha256_bytes(in :: Bytes || Port.Input) :: Bytes

Computes the SHA-1, SHA-224, or SHA-256 hash of the content of in. The result is reported as a byte string containing the bits of the hash.

> crypto_hash.sha1_bytes(#"apple")

#"\320\276-\304!\276O\315\1r\345\257\316\3529p\342\363\331@".copy()