| 651 | }); |
| 652 | |
| 653 | function buildBytecode( |
| 654 | executableSection: string, |
| 655 | metadataSection: string, |
| 656 | ): string { |
| 657 | // calculate the length of the metadata section in bytes |
| 658 | // and pad it to the required size |
| 659 | const metadataBytesLength = metadataSection.length / 2; |
| 660 | const metadataSectionLength = metadataBytesLength |
| 661 | .toString(16) |
| 662 | .padStart(METADATA_LENGTH_FIELD_SIZE * 2, "0"); |
| 663 | |
| 664 | return executableSection + metadataSection + metadataSectionLength; |
| 665 | } |
| 666 | |
| 667 | function buildCompilerOutputBytecode( |
| 668 | bytecode: string, |