1SHA
9.0
top
← prev up next →

SHA and SHA-2πŸ”— i

(require sha ) package: sha

Provides a Racket interface to the OpenSSL implementation of SHA-1 and SHA-2.

SHA-2 includes four flavors: SHA-224, SHA-256, SHA-384, and SHA-512.

1SHAπŸ”— i

procedure

( sha1bstr)sha1?

bstr:bytes?

procedure

( sha224bstr)sha224?

bstr:bytes?

procedure

( sha256bstr)sha256?

bstr:bytes?

procedure

( sha384bstr)sha384?

bstr:bytes?

procedure

( sha512bstr)sha512?

bstr:bytes?
Calculate the SHA hash of bstr.

2HMAC-SHAπŸ”— i

procedure

( hmac-sha1keydata)sha1?

key:bytes?
data:bytes?

procedure

( hmac-sha224keydata)sha224?

key:bytes?
data:bytes?

procedure

( hmac-sha256keydata)sha256?

key:bytes?
data:bytes?

procedure

( hmac-sha384keydata)sha384?

key:bytes?
data:bytes?

procedure

( hmac-sha512keydata)sha512?

key:bytes?
data:bytes?
HMAC-SHA encode key and data.

3Hex stringπŸ”— i

procedure

( bytes->hex-stringbstr)string?

bstr:bytes?
Convert bstr to a hexadecimal string represention.

4Predicates for contractsπŸ”— i

procedure

( sha1?x)boolean?

x:any/c
Is x a bytes? of length 20?

procedure

( sha224?x)boolean?

x:any/c
Is x a bytes? of length 28?

procedure

( sha256?x)boolean?

x:any/c
Is x a bytes? of length 32?

procedure

( sha384?x)boolean?

x:any/c
Is x a bytes? of length 48?

procedure

( sha512?x)boolean?

x:any/c
Is x a bytes? of length 64?

top
← prev up next →

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /