Logo Decentralized Social Network

moeralib/node/fingerprints

Functions

createAttachmentFingerprint0(objectType, digest)

Parameters:
objectType:  string | null – ATTACHMENT
digest:  Buffer | null – cryptographic hash of the attachment as a file
Return value:
Buffer - the fingerprint in binary form

createCarteFingerprint3(objectType, ownerName, addresses, beginning, deadline, nodeName, clientScope, adminScope, salt)

Parameters:
objectType:  string | null – CARTE
ownerName:  string | null
addresses:  string[] | null – IP addresses of the client
beginning:  number | null – timestamp of the beginning of the carte's life
deadline:  number | null – timestamp of the end of the carte's life
nodeName:  string | null – if set, the carte is valid for authentication on the specified node only
clientScope:  number | null – A bit mask describing which permissions should be granted to the carte. If not set, all permissions of the carte's owner are granted. Meaning of particular bits can be seen in the description of Scope enum
adminScope:  number | null – A bit mask describing which additional administrative permissions (of those granted to the carte's owner by the target node) should be granted to the carte. Meaning of particular bits can be seen in the description of Scope enum
salt:  Buffer | null – 8 random bytes
Return value:
Buffer - the fingerprint in binary form

createCarteFingerprint2(objectType, ownerName, address, beginning, deadline, nodeName, clientScope, adminScope, salt)

Parameters:
objectType:  string | null – CARTE
ownerName:  string | null
address:  string | null – IP address of the client
beginning:  number | null – timestamp of the beginning of the carte's life
deadline:  number | null – timestamp of the end of the carte's life
nodeName:  string | null – if set, the carte is valid for authentication on the specified node only
clientScope:  number | null – A bit mask describing which permissions should be granted to the carte. If not set, all permissions of the carte's owner are granted. Meaning of particular bits can be seen in the description of Scope enum
adminScope:  number | null – A bit mask describing which additional administrative permissions (of those granted to the carte's owner by the target node) should be granted to the carte. Meaning of particular bits can be seen in the description of Scope enum
salt:  Buffer | null – 8 random bytes
Return value:
Buffer - the fingerprint in binary form

createCarteFingerprint1(objectType, ownerName, address, beginning, deadline, nodeName, authCategory, salt)

Parameters:
objectType:  string | null – CARTE
ownerName:  string | null
address:  string | null – IP address of the client
beginning:  number | null – timestamp of the beginning of the carte's life
deadline:  number | null – timestamp of the end of the carte's life
nodeName:  string | null – if set, the carte is valid for authentication on the specified node only
authCategory:  number | null – A bit mask describing which permissions should be granted to the carte. If not set, all permissions of the carte's owner are granted. The bits have the following meaning:
  • other (0x0001) - any other permission not listed below;
  • view-media (0x0002) - view media files.
salt:  Buffer | null – 8 random bytes
Return value:
Buffer - the fingerprint in binary form

createCarteFingerprint0(objectType, ownerName, address, beginning, deadline, permissions, salt)

Parameters:
objectType:  string | null – CARTE
ownerName:  string | null
address:  string | null – IP address of the client
beginning:  number | null – timestamp of the beginning of the carte's life
deadline:  number | null – timestamp of the end of the carte's life
permissions:  number | null – 0 (reserved for future use)
salt:  Buffer | null – 8 random bytes
Return value:
Buffer - the fingerprint in binary form

createCommentFingerprint1(objectType, ownerName, postingFingerprint, repliedToFingerprint, bodySrcHash, bodySrcFormat, body, bodyFormat, createdAt, permissions, attachments)

Parameters:
objectType:  string | null – COMMENT
ownerName:  string | null
postingFingerprint:  Buffer | null
repliedToFingerprint:  Buffer | null
bodySrcHash:  Buffer | null – hash of bodySrc field
bodySrcFormat:  string | null
body:  string | null
bodyFormat:  string | null
createdAt:  number | null – of the current revision
permissions:  number | null – 0 (reserved for future use)
attachments:  Buffer[] | null
Return value:
Buffer - the fingerprint in binary form

createCommentFingerprint0(objectType, ownerName, postingFingerprint, repliedToFingerprint, bodySrcHash, bodySrcFormat, body, bodyFormat, createdAt, permissions, attachments)

Parameters:
objectType:  string | null – COMMENT
ownerName:  string | null
postingFingerprint:  Buffer | null
repliedToFingerprint:  Buffer | null – bug: if repliedTo is null, this field should be set to digest of a fingerprint containing single null value
bodySrcHash:  Buffer | null – hash of bodySrc field
bodySrcFormat:  string | null
body:  string | null
bodyFormat:  string | null
createdAt:  number | null – of the current revision
permissions:  number | null – 0 (reserved for future use)
attachments:  Buffer[] | null
Return value:
Buffer - the fingerprint in binary form

createMediaGrantFingerprint1(objectType, nodeName, mediaId, expires, download, fileName, salt)

Parameters:
objectType:  string | null – MEDIA_GRANT
nodeName:  string | null – name of the node that grants media access, null for the target node itself
mediaId:  string | null – ID of the accessed media on the target node
expires:  number | null – timestamp when the grant expires
download:  boolean | null – whether the media should be downloaded
fileName:  string | null – the preferred name of the media file when it is downloaded
salt:  Buffer | null – 8 random bytes
Return value:
Buffer - the fingerprint in binary form

createMediaGrantFingerprint0(objectType, nodeName, postingId, commentId, mediaId, expires, download, fileName, salt)

Parameters:
objectType:  string | null – MEDIA_GRANT
nodeName:  string | null – name of the node that grants media access, null for the target node itself
postingId:  string | null – ID of the posting that grants media access
commentId:  string | null – ID of the comment that grants media access, if any
mediaId:  string | null – ID of the accessed media on the target node
expires:  number | null – timestamp when the grant expires
download:  boolean | null – whether the media should be downloaded
fileName:  string | null – the preferred name of the media file when it is downloaded
salt:  Buffer | null – 8 random bytes
Return value:
Buffer - the fingerprint in binary form

createNotificationPacketFingerprint2(objectType, id, nodeName, fullName, nodeSourceUri, createdAt, type, notification)

Parameters:
objectType:  string | null – NOTIFICATION_PACKET
id:  string | null
nodeName:  string | null
fullName:  string | null
nodeSourceUri:  string | null
createdAt:  number | null
type:  string | null
notification:  string | null
Return value:
Buffer - the fingerprint in binary form

createNotificationPacketFingerprint1(objectType, id, nodeName, fullName, createdAt, type, notification)

Parameters:
objectType:  string | null – NOTIFICATION_PACKET
id:  string | null
nodeName:  string | null
fullName:  string | null
createdAt:  number | null
type:  string | null
notification:  string | null
Return value:
Buffer - the fingerprint in binary form

createNotificationPacketFingerprint0(objectType, id, nodeName, createdAt, type, notification)

Parameters:
objectType:  string | null – NOTIFICATION_PACKET
id:  string | null
nodeName:  string | null
createdAt:  number | null
type:  string | null
notification:  string | null
Return value:
Buffer - the fingerprint in binary form

createPostingFingerprint1(objectType, receiverName, ownerName, bodySrcHash, bodySrcFormat, body, bodyFormat, createdAt, permissions, attachments)

Parameters:
objectType:  string | null – POSTING
receiverName:  string | null
ownerName:  string | null
bodySrcHash:  Buffer | null – hash of bodySrc field
bodySrcFormat:  string | null
body:  string | null
bodyFormat:  string | null
createdAt:  number | null – of the current revision
permissions:  number | null – 0 (reserved for future use)
attachments:  Buffer[] | null – if the posting is linked to a media, its fingerprint should be put at the beginning of the list
Return value:
Buffer - the fingerprint in binary form

createPostingFingerprint0(objectType, receiverName, ownerName, bodySrcHash, bodySrcFormat, body, bodyFormat, createdAt, permissions, attachments)

Parameters:
objectType:  string | null – POSTING
receiverName:  string | null
ownerName:  string | null
bodySrcHash:  Buffer | null – hash of bodySrc field
bodySrcFormat:  string | null
body:  string | null
bodyFormat:  string | null
createdAt:  number | null – of the current revision
permissions:  number | null – 0 (reserved for future use)
attachments:  number | null – 0 (reserved for future use)
Return value:
Buffer - the fingerprint in binary form

createPushRelayMessageFingerprint0(objectType, signedAt)

Parameters:
objectType:  string | null – PUSH_RELAY_MESSAGE
signedAt:  number | null
Return value:
Buffer - the fingerprint in binary form

createPushRelayRegisterFingerprint0(objectType, clientId, lang, signedAt)

Parameters:
objectType:  string | null – PUSH_RELAY_REGISTER
clientId:  string | null
lang:  string | null
signedAt:  number | null
Return value:
Buffer - the fingerprint in binary form

createReactionFingerprint0(objectType, ownerName, entryFingerprint, negative, emoji)

Parameters:
objectType:  string | null – REACTION
ownerName:  string | null
entryFingerprint:  Buffer | null – hash of Posting or Comment fingerprint
negative:  boolean | null
emoji:  number | null
Return value:
Buffer - the fingerprint in binary form

createSheriffOrderFingerprint0(objectType, sheriffName, nodeName, feedName, entryFingerprint, category, reasonCode, reasonDetails, createdAt)

Parameters:
objectType:  string | null – SHERIFF_ORDER
sheriffName:  string | null
nodeName:  string | null
feedName:  string | null
entryFingerprint:  Buffer | null – hash of Posting or Comment fingerprint
category:  string | null
reasonCode:  string | null
reasonDetails:  string | null
createdAt:  number | null
Return value:
Buffer - the fingerprint in binary form