Skip to content

Latest commit

 

History

History
142 lines (108 loc) · 3.07 KB

File metadata and controls

142 lines (108 loc) · 3.07 KB
layout default
menu_item api
title Oid
description Version 0.19.0
return_to
API Documentation Index
/api/
sections
fromString #cmp #cpy #equal #iszero #ncmp #strcmp #streq #tostrS
#fromString
#cmp
#cpy
#equal
#iszero
#ncmp
#strcmp
#streq
#tostrS

Oid.fromString Sync

var oid = Oid.fromString(str);
Parameters Type
str String input hex string; must be pointing at the start of the hex sequence and have at least the number of bytes needed for an oid encoded in hex (40 bytes).
Returns
Oid oid structure the result is written into.

Oid#cmp Sync

var result = oid.cmp(b);

| Parameters | Type | | --- | --- | --- | | b | Oid | second oid structure. |

Returns
Number
<
0, 0, >0 if a
<
b, a == b, a > b.

Oid#cpy Sync

var oid = oid.cpy();
Returns
Oid oid structure the result is written into.

Oid#equal Sync

var result = oid.equal(b);

| Parameters | Type | | --- | --- | --- | | b | Oid | second oid structure. |

Returns
Number true if equal, false otherwise

Oid#iszero Sync

var result = oid.iszero();
Returns
Number 1 if all zeros, 0 otherwise.

Oid#ncmp Sync

var result = oid.ncmp(b, len);

| Parameters | Type | | --- | --- | --- | | b | Oid | second oid structure. | | len | Number | the number of hex chars to compare |

Returns
Number 0 in case of a match

Oid#strcmp Sync

var result = oid.strcmp(str);

| Parameters | Type | | --- | --- | --- | | str | String | input hex string of an object id. |

Returns
Number -1 if str is not valid,
<
0 if id sorts before str,
     0 if id matches str, >0 if id sorts after str. |

Oid#streq Sync

var result = oid.streq(str);

| Parameters | Type | | --- | --- | --- | | str | String | input hex string of an object id. |

Returns
Number 0 in case of a match, -1 otherwise.

Oid#tostrS Sync

var string = oid.tostrS();
Returns
String the c-string