# Hashing functions
Name | Description | Complexity |
---|---|---|
blake2b256 | Range of functions. Hash an array of bytes using BLAKE2b-256 | 13–136 |
keccak256 | Range of functions. Hash an array of bytes using Keccak-256 | 20–195 |
sha256 | Range of functions. Hash an array of bytes using SHA-256 | 12–118 |
# blake2b256
Range of functions that hash an array of bytes using BLAKE2b-256.
Name | Max data size | Complexity |
---|---|---|
blake2b256(bytes: ByteVector): ByteVector | 150 kB | 136 |
blake2b256_16Kb(bytes: ByteVector): ByteVector | 16 kB | 13 |
blake2b256_32Kb(bytes: ByteVector): ByteVector | 32 kB | 29 |
blake2b256_64Kb(bytes: ByteVector): ByteVector | 64 kB | 58 |
blake2b256_128Kb(bytes: ByteVector): ByteVector | 128 kB | 115 |
# 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 | 195 |
keccak256_16Kb(bytes: ByteVector): ByteVector | 16 kB | 20 |
keccak256_32Kb(bytes: ByteVector): ByteVector | 32 kB | 39 |
keccak256_64Kb(bytes: ByteVector): ByteVector | 64 kB | 74 |
keccak256_128Kb(bytes: ByteVector): ByteVector | 128 kB | 147 |
# 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 | 118 |
sha256_16Kb(bytes: ByteVector): ByteVector | 16 kB | 12 |
sha256_32Kb(bytes: ByteVector): ByteVector | 32 kB | 23 |
sha256_64Kb(bytes: ByteVector): ByteVector | 64 kB | 47 |
sha256_128Kb(bytes: ByteVector): ByteVector | 128 kB | 93 |
# 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