use of ntohl and htonl from npm library instead of own implementation