Bundle Cryptographic utilities including AES-256 encryption/decryption, SHA-1/256/512 and MD5 hashing, HMAC signing, and Base64 encoding/decoding. Compile with -lib cipher.
Hash
Support for one-way hashes
Operations
MD5 # function
Hash input using MD5
function : MD5(stream_in:Byte[]) ~ Byte[]Parameters
| Name | Type | Description |
|---|---|---|
| stream_in | Byte | bytes to hashed |
Return
| Type | Description |
|---|---|
| Byte | hashed bytes |
Example
bytes := "checksum-data"->ToByteArray();
hash := Cipher.Hash->MD5(bytes); # 16-byte MD5 digest
Cipher.Encrypt->Base64(hash)->PrintLine();RIPEMD160 # function
Hash input using RIPEMD digest
function : RIPEMD160(stream_in:Byte[]) ~ Byte[]Parameters
| Name | Type | Description |
|---|---|---|
| stream_in | Byte | bytes to hashed |
Return
| Type | Description |
|---|---|
| Byte | hashed bytes |
Example
bytes := "blockchain-data"->ToByteArray();
hash := Cipher.Hash->RIPEMD160(bytes); # 20-byte digest
Cipher.Encrypt->Base64(hash)->PrintLine();SHA1 # function
Hash input using SHA-1
function : SHA1(stream_in:Byte[]) ~ Byte[]Parameters
| Name | Type | Description |
|---|---|---|
| stream_in | Byte | bytes to hashed |
Return
| Type | Description |
|---|---|
| Byte | hashed bytes |
Example
bytes := "Hello World"->ToByteArray();
hash := Cipher.Hash->SHA1(bytes); # compute SHA-1 digest
Cipher.Encrypt->Base64(hash)->PrintLine(); # print as Base64SHA256 # function
Hash input using SHA-256
function : SHA256(stream_in:Byte[]) ~ Byte[]Parameters
| Name | Type | Description |
|---|---|---|
| stream_in | Byte | bytes to hashed |
Return
| Type | Description |
|---|---|
| Byte | hashed bytes |
Example
bytes := "password123"->ToByteArray();
hash := Cipher.Hash->SHA256(bytes); # compute SHA-256 digest
Cipher.Encrypt->Base64(hash)->PrintLine(); # print as Base64SHA512 # function
Hash input using SHA-512
function : SHA512(stream_in:Byte[]) ~ Byte[]Parameters
| Name | Type | Description |
|---|---|---|
| stream_in | Byte | bytes to hashed |
Return
| Type | Description |
|---|---|
| Byte | hashed bytes |
Example
bytes := "secret"->ToByteArray();
hash := Cipher.Hash->SHA512(bytes); # 64-byte digest
Cipher.Encrypt->Base64(hash)->PrintLine();