3.1.4.4.1 Constructing a PNRP ID

The Resolver MUST first separate the Peer Name into its authority and classifier parts. The authority MUST then be converted to the 160-bit binary number (which is called the BinaryAuthority) that corresponds to the 40 hexadecimal digits in the Authority string.

A ServiceLocation MUST then be constructed by concatenating the 64-bit ServiceLocationPrefix, and then the 64-bit ServiceLocationSuffix value.

Finally, the BinaryAuthority, Classifier, and ServiceLocation MUST then be converted to a PNRP ID by using the following formulas

 ClassifierHash = SHA-1(Classifier)
 P2PID = First 16 bytes(SHA-1(ClassifierHash, BinaryAuthority, ClassifierHash, "PNRP"))
 PNRP ID = (P2PID << 128) | ServiceLocation

where SHA-1() indicates an SHA-1 hash as specified in [RFC3174], and "PNRP" is a 4-byte ASCII string. (Note that SHA-1 provides a 20-byte value, from which the P2PID formula drops the final 4 bytes to produce a result which is 128 bits in length.)