@fruitsjs/contracts
Version:
Smart Contracts package for Fruits Eco-Blockchain
14 lines (12 loc) • 364 B
text/typescript
import {CodePageSize} from './constants';
/**
* Counts the code pages for given machine code
*
* @param hexCode The contracts code in hex form
* @return The number of code pages for the passed code
*
* @module contracts
*/
export function countCodePages(hexCode: string ): number {
return Math.ceil((hexCode.length / 2) / CodePageSize);
}