Subversion Repositories oidinfo_api

Rev

Rev 16 | Rev 23 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 16 Rev 17
Line 220... Line 220...
220
/**
220
/**
221
 * Outputs the depth of an OID.
221
 * Outputs the depth of an OID.
222
 * @author  Daniel Marschall, ViaThinkSoft
222
 * @author  Daniel Marschall, ViaThinkSoft
223
 * @version 2014-12-09
223
 * @version 2014-12-09
224
 * @param   string $oid An OID in dot notation (with or without leading dot)
224
 * @param   string $oid An OID in dot notation (with or without leading dot)
225
 * @return  (int) The depth of the OID, e.g. 2.999 and .2.999 has the length 2.
225
 * @return  int The depth of the OID, e.g. 2.999 and .2.999 has the length 2.
226
 **/
226
 **/
227
function oid_len($oid) {
227
function oid_len($oid) {
228
        if ($oid == '') return 0;
228
        if ($oid == '') return 0;
229
        if ($oid[0] == '.') $oid = substr($oid, 1);
229
        if ($oid[0] == '.') $oid = substr($oid, 1);
230
        return substr_count($oid, '.')+1;
230
        return substr_count($oid, '.')+1;
Line 639... Line 639...
639
/**
639
/**
640
 * Returns an associative array in the form 'ASN.1' => '/2/1' .
640
 * Returns an associative array in the form 'ASN.1' => '/2/1' .
641
 * @author  Daniel Marschall, ViaThinkSoft
641
 * @author  Daniel Marschall, ViaThinkSoft
642
 * @version 2018-01-05
642
 * @version 2018-01-05
643
 * @see http://itu.int/go/X660
643
 * @see http://itu.int/go/X660
644
 * @return  (array) An associative array in the form 'ASN.1' => '/2/1' .
644
 * @return array<string,string> An associative array in the form 'ASN.1' => '/2/1' .
645
 **/
645
 **/
646
function iri_get_long_arcs() {
646
function iri_get_long_arcs() {
647
        $iri_long_arcs = array();
647
        $iri_long_arcs = array();
648
        $iri_long_arcs['ASN.1'] = '/2/1';
648
        $iri_long_arcs['ASN.1'] = '/2/1';
649
        $iri_long_arcs['Country'] = '/2/16';
649
        $iri_long_arcs['Country'] = '/2/16';
Line 745... Line 745...
745
 * Returns an array of standardized ASN.1 alphanumeric identifiers which do not require a numeric identifier, e.g. { 2 example }
745
 * Returns an array of standardized ASN.1 alphanumeric identifiers which do not require a numeric identifier, e.g. { 2 example }
746
 * The array has the form '0.0.a' -> '0.0.1'
746
 * The array has the form '0.0.a' -> '0.0.1'
747
 * @author  Daniel Marschall, ViaThinkSoft
747
 * @author  Daniel Marschall, ViaThinkSoft
748
 * @version 2019-03-25
748
 * @version 2019-03-25
749
 * @see http://www.oid-info.com/name-forms.htm
749
 * @see http://www.oid-info.com/name-forms.htm
750
 * @return  (array) Associative array of standardized ASN.1 alphanumeric identifiers
750
 * @return  array<string,string> Associative array of standardized ASN.1 alphanumeric identifiers
751
 **/
751
 **/
752
function asn1_get_standardized_array() {
752
function asn1_get_standardized_array() {
753
 
753
 
754
        // Taken from oid-info.com
754
        // Taken from oid-info.com
755
        // http://www.oid-info.com/name-forms.htm
755
        // http://www.oid-info.com/name-forms.htm