crypto¶
The crypto package contains functionality for generating hash strings.
Package Functions¶
md5_hash(input = "")¶
Generates an MD5 hash string.
Parameters
| Type | Name | Description |
|---|---|---|
string |
input |
The input string. |
Returns
| Type | Description |
|---|---|
string |
An MD5 hash. |
Example
import "crypto"
var hash = crypto::md5_hash("hello")
println hash
# 5d41402abc4b2a76b9719d911017c592
sha224_hash(input = "")¶
Generates a SHA-224 hash string.
Parameters
| Type | Name | Description |
|---|---|---|
string |
input |
The input string. |
Returns
| Type | Description |
|---|---|
string |
A SHA-224 hash. |
Example
import "crypto"
var hash = crypto::sha224_hash("hello")
println hash
# ea09ae9cc6768c50fcee903ed054556e5bfc8347907f12598aa24193
sha256_hash(input = "")¶
Generates a SHA-256 hash string.
Parameters
| Type | Name | Description |
|---|---|---|
string |
input |
The input string. |
Returns
| Type | Description |
|---|---|
string |
A SHA-256 hash. |
Example