Fix keyId types in JSDoc comments (#1100)
This commit is contained in:
parent
1b91d428f0
commit
320efc2435
|
@ -198,7 +198,7 @@ PublicKey.prototype.getCreationTime = function() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the key id of the key
|
* Calculates the key id of the key
|
||||||
* @returns {String} A 8 byte key id
|
* @returns {module:type/keyid} A 8 byte key id
|
||||||
*/
|
*/
|
||||||
PublicKey.prototype.getKeyId = function () {
|
PublicKey.prototype.getKeyId = function () {
|
||||||
if (this.keyid) {
|
if (this.keyid) {
|
||||||
|
|
|
@ -44,10 +44,18 @@ Keyid.prototype.read = function(bytes) {
|
||||||
this.bytes = util.Uint8Array_to_str(bytes.subarray(0, 8));
|
this.bytes = util.Uint8Array_to_str(bytes.subarray(0, 8));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializes the Key ID
|
||||||
|
* @returns {Uint8Array} Key ID as a Uint8Array
|
||||||
|
*/
|
||||||
Keyid.prototype.write = function() {
|
Keyid.prototype.write = function() {
|
||||||
return util.str_to_Uint8Array(this.bytes);
|
return util.str_to_Uint8Array(this.bytes);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Key ID represented as a hexadecimal string
|
||||||
|
* @returns {String} Key ID as a hexadecimal string
|
||||||
|
*/
|
||||||
Keyid.prototype.toHex = function() {
|
Keyid.prototype.toHex = function() {
|
||||||
return util.str_to_hex(this.bytes);
|
return util.str_to_hex(this.bytes);
|
||||||
};
|
};
|
||||||
|
@ -61,10 +69,18 @@ Keyid.prototype.equals = function(keyid, matchWildcard = false) {
|
||||||
return (matchWildcard && (keyid.isWildcard() || this.isWildcard())) || this.bytes === keyid.bytes;
|
return (matchWildcard && (keyid.isWildcard() || this.isWildcard())) || this.bytes === keyid.bytes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks to see if the Key ID is unset
|
||||||
|
* @returns {Boolean} true if the Key ID is null
|
||||||
|
*/
|
||||||
Keyid.prototype.isNull = function() {
|
Keyid.prototype.isNull = function() {
|
||||||
return this.bytes === '';
|
return this.bytes === '';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks to see if the Key ID is a "wildcard" Key ID (all zeros)
|
||||||
|
* @returns {Boolean} true if this is a wildcard Key ID
|
||||||
|
*/
|
||||||
Keyid.prototype.isWildcard = function() {
|
Keyid.prototype.isWildcard = function() {
|
||||||
return /^0+$/.test(this.toHex());
|
return /^0+$/.test(this.toHex());
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user