From 1eb7eaaccf51c953c5e0279b5249c0761d46fb2b Mon Sep 17 00:00:00 2001 From: akwizgran Date: Mon, 23 Mar 2015 22:38:36 +0000 Subject: [PATCH] akwizgran created page: BSP --- BSP.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BSP.markdown b/BSP.markdown index a290d9f..e6dde95 100644 --- a/BSP.markdown +++ b/BSP.markdown @@ -14,8 +14,8 @@ Each channel has a unique identifier hash_len bytes long. This identifier is sup ### Message format -Each message consists of one or more blocks, each block_len bytes long, except the last block, which may be shorter. The blocks form the leaves of a binary hash tree. Each parent node consists of the concatenated hashes of its children. +Each message consists of one or more blocks, each of which is block_len bytes long, except the last block, which may be shorter. The blocks form the leaves of a binary hash tree. Each parent node consists of the concatenated hashes of its children. If the number of blocks is not a power of two, some parent nodes will only have one child. -The message's unique identifier is calculated by hashing a message header followed by the root node of the hash tree. The message header consists of the channel identifier, a timestamp, the message type, and the depth of the tree. +The message's unique identifier is calculated by hashing a message header concatenated with the root node of the hash tree. The message header consists of the channel identifier, a timestamp, the message type, and the depth of the tree excluding leaves. -The timestamp is a 64-bit big-endian integer representing the time at which the message was created, measured in seconds since the Unix epoch. The message type is a single byte that is supplied by the application and not interpreted by BSP. The depth of the tree is an 8-bit integer. The total length of the message header is hash_len + 10 bytes. +The timestamp is a 64-bit big-endian integer representing the time at which the message was created, in seconds since the Unix epoch. The message type is a single byte that is supplied by the application and not interpreted by BSP. The depth of the tree is an 8-bit integer. The total length of the message header is hash_len + 10 bytes.