util for converting toCodeHash