hostid: fix behavior on identifiers starting with zeros