NewOID converts an object ID in hex format (i.e., `[0-9a-f]{40}`) into an `OID`.
(s string)
| 28 | // NewOID converts an object ID in hex format (i.e., `[0-9a-f]{40}`) |
| 29 | // into an `OID`. |
| 30 | func NewOID(s string) (OID, error) { |
| 31 | oidBytes, err := hex.DecodeString(s) |
| 32 | if err != nil { |
| 33 | return OID{}, err |
| 34 | } |
| 35 | return OIDFromBytes(oidBytes) |
| 36 | } |
| 37 | |
| 38 | // String formats `oid` as a string in hex format. |
| 39 | func (oid OID) String() string { |
no test coverage detected