# [Ride v5] Hashing functions
⚠️ This is the documentation for the Standard library version 5. We recommend to use version 6. Go to version 6
| Name | Description | Complexity |
|---|---|---|
| blake2b256 | Range of functions. Hash an array of bytes using BLAKE2b-256 | 10–200 |
| keccak256 | Range of functions. Hash an array of bytes using Keccak-256 | 10–200 |
| sha256 | Range of functions. Hash an array of bytes using SHA-256 | 10–200 |
# blake2b256
Range of functions that hash an array of bytes using BLAKE2b-256.
| Name | Max data size | Complexity |
|---|---|---|
| blake2b256(bytes: ByteVector): ByteVector | 150 kB | 200 |
| blake2b256_16Kb(bytes: ByteVector): ByteVector | 16 kB | 10 |
| blake2b256_32Kb(bytes: ByteVector): ByteVector | 32 kB | 25 |
| blake2b256_64Kb(bytes: ByteVector): ByteVector | 64 kB | 50 |
| blake2b256_128Kb(bytes: ByteVector): ByteVector | 128 kB | 100 |
# Parameters
| Parameter | Description |
|---|---|
bytes: ByteVector | The array of bytes to encode. Maximum size: • For blake2b256_<N>Kb functions — N kB.• For blake2b256 function — 150 kB. |
# Examples
blake2b256("Ride".toBytes()) # Returns 6NSWRz5XthhFVm9uVQHuisdaseQJfc4WMGajN435v3f4
blake2b256(125.toBytes()) # Returns H9emWhyMuyyjDmNkgx7jAfHRuy9icXK3uYJuVw6R1uuK
blake2b256(base16'52696465') # Returns 6NSWRz5XthhFVm9uVQHuisdaseQJfc4WMGajN435v3f4
blake2b256(base58'37BPKA') # Returns 6NSWRz5XthhFVm9uVQHuisdaseQJfc4WMGajN435v3f4
blake2b256(base64'UmlkZQ==') # Returns 6NSWRz5XthhFVm9uVQHuisdaseQJfc4WMGajN435v3f4
# keccak256
Range of functions that hash an array of bytes using Keccak-256.
| Name | Max data size | Complexity |
|---|---|---|
| keccak256(bytes: ByteVector): ByteVector | 150 kB | 200 |
| keccak256_16Kb(bytes: ByteVector): ByteVector | 16 kB | 10 |
| keccak256_32Kb(bytes: ByteVector): ByteVector | 32 kB | 25 |
| keccak256_64Kb(bytes: ByteVector): ByteVector | 64 kB | 50 |
| keccak256_128Kb(bytes: ByteVector): ByteVector | 128 kB | 100 |
# Parameters
| Parameter | Description |
|---|---|
bytes: ByteVector | The array of bytes to encode. Maximum size: • For keccak256_<N>Kb functions — N kB.• For keccak256 function — 150 kB. |
# Examples
keccak256("Ride".toBytes()) # Returns 4qa5wNk4961VwJAjCKBzXiEvBQ2gBJoqDcLFRJTiSKpv
keccak256(125.toBytes()) # Returns 5UUkcH6Fp2E3mk7NSqSTs3JBP33zL3SB3yg4b2sR5gpF
keccak256(base16'52696465') # Returns 4qa5wNk4961VwJAjCKBzXiEvBQ2gBJoqDcLFRJTiSKpv
keccak256(base58'37BPKA') # Returns 4qa5wNk4961VwJAjCKBzXiEvBQ2gBJoqDcLFRJTiSKpv
keccak256(base64'UmlkZQ==') # Returns 4qa5wNk4961VwJAjCKBzXiEvBQ2gBJoqDcLFRJTiSKpv
# sha256
Range of functions that hash an array of bytes using SHA-256
| Name | Max data size | Complexity |
|---|---|---|
| sha256(bytes: ByteVector): ByteVector | 150 kB | 200 |
| sha256_16Kb(bytes: ByteVector): ByteVector | 16 kB | 10 |
| sha256_32Kb(bytes: ByteVector): ByteVector | 32 kB | 25 |
| sha256_64Kb(bytes: ByteVector): ByteVector | 64 kB | 50 |
| sha256_128Kb(bytes: ByteVector): ByteVector | 128 kB | 100 |
# Parameters
| Parameter | Description |
|---|---|
bytes: ByteVector | The array of bytes to encode. Maximum size: • For sha256_<N>Kb functions — N kB.• For sha256 function — 150 kB. |
# Examples
sha256("Ride".toBytes()) # Returns 5YxvrKsjJtq4G325gRVxbXpkox1sWdHUGVJLnRFqTWD3
sha256(125.toBytes()) # Returns A56kbJjy7A4B9Pa5tUgRNvtCHSsZ7pZVJuPsLT2vtPSU
sha256(base16'52696465') # Returns 5YxvrKsjJtq4G325gRVxbXpkox1sWdHUGVJLnRFqTWD3
sha256(base58'37BPKA') # Returns 5YxvrKsjJtq4G325gRVxbXpkox1sWdHUGVJLnRFqTWD3
sha256(base64'UmlkZQ==') # Returns 5YxvrKsjJtq4G325gRVxbXpkox1sWdHUGVJLnRFqTWD3