simplify nodeId encoding func