Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

ByteArrayExtTrait

Fully qualified path: openzeppelin_utils::bytearray::ByteArrayExtTrait

pub trait ByteArrayExtTrait

Trait functions

read_n_bytes

Requirements:

  • start + n must be less than or equal to the length of the byte array.

Fully qualified path: openzeppelin_utils::bytearray::ByteArrayExtTrait::read_n_bytes

fn read_n_bytes(self: @ByteArray, start: u32, n: u32) -> ByteArray

to_byte_array

Converts a value to a byte array with a given base and padding.

Requirements:

  • base cannot be zero.

Fully qualified path: openzeppelin_utils::bytearray::ByteArrayExtTrait::to_byte_array

fn to_byte_array<T, +Into<T, felt252>, +Copy<T>>(self: @T, base: u8, padding: u16) -> ByteArray

hash

Hashes a byte array using the Pedersen hash algorithm. Encodes the byte array as a ´Span´ by serializing ´data´.

Fully qualified path: openzeppelin_utils::bytearray::ByteArrayExtTrait::hash

fn hash(self: @ByteArray) -> felt252