Skip to content

Commit

Permalink
doc: byteArrayToString docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
obatirou committed Sep 19, 2024
1 parent 705b988 commit f5d4b83
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/CairoLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,13 @@ library CairoLib {
/// @dev A ByteArray is represented as:
/**
* pub struct ByteArray {
* data_len: felt252,
* data: [<bytes31>],
* pending_word: felt252,
* pending_word_len: usize,
* }
* where `data` is an array of 31-byte packed words, and `pending_word` word of size `pending_word_len`.
* full_words_len: felt252,
* full_words: [<bytes31>],
* pending_word: felt252,
* pending_word_len: usize,
* }
* where `full_words` is an array of 31-byte packed words, and `pending_word` word of size `pending_word_len`.
* Note that those full words are 32 bytes long, but only 31 bytes are used.
*/
/// @param data The Cairo representation of the ByteArray serialized to bytes.
function byteArrayToString(bytes memory data) internal pure returns (string memory) {
Expand Down

0 comments on commit f5d4b83

Please sign in to comment.