[#84] Clarify JSON encoding for OID, CID and OwnerID

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
This commit is contained in:
Stanislav Bogatyrev 2020-12-14 19:40:12 +03:00 committed by Stanislav Bogatyrev
parent 953b2750a2
commit 47c7452eb2

View file

@ -19,10 +19,19 @@ message Address {
// NeoFS Object unique identifier. Objects are immutable and content-addressed. // NeoFS Object unique identifier. Objects are immutable and content-addressed.
// It means `ObjectID` will change if `header` or `payload` changes. // It means `ObjectID` will change if `header` or `payload` changes.
// //
// `ObjectID` is a 32 byte long SHA256 hash of object's `header` field, which, // `ObjectID` is a 32 byte long
// in it's turn, contains hash of object's payload. // [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of
// object's `header` field, which, in it's turn, contains hash of object's
// payload.
// //
// String presentation is base58 encoded string. // String presentation is
// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string.
//
// JSON value will be the data encoded as a string using standard base64
// encoding with paddings. Either
// [standard](https://tools.ietf.org/html/rfc4648#section-4) or
// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding
// with/without paddings are accepted.
message ObjectID { message ObjectID {
// Object identifier in a binary format // Object identifier in a binary format
bytes value = 1 [json_name = "value"]; bytes value = 1 [json_name = "value"];
@ -31,10 +40,18 @@ message ObjectID {
// NeoFS container identifier. Container structures are immutable and // NeoFS container identifier. Container structures are immutable and
// content-addressed. // content-addressed.
// //
// `ContainerID` is a 32 byte long SHA256 hash of stable-marshalled container // `ContainerID` is a 32 byte long
// message. // [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of
// stable-marshalled container message.
// //
// String presentation is base58 encoded string. // String presentation is
// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string.
//
// JSON value will be the data encoded as a string using standard base64
// encoding with paddings. Either
// [standard](https://tools.ietf.org/html/rfc4648#section-4) or
// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding
// with/without paddings are accepted.
message ContainerID { message ContainerID {
// Container identifier in a binary format. // Container identifier in a binary format.
bytes value = 1 [json_name = "value"]; bytes value = 1 [json_name = "value"];
@ -47,7 +64,14 @@ message ContainerID {
// `OwnerID` is a 25 bytes sequence starting with Neo version prefix byte // `OwnerID` is a 25 bytes sequence starting with Neo version prefix byte
// followed by 20 bytes of ScrptHash and 4 bytes of checksum. // followed by 20 bytes of ScrptHash and 4 bytes of checksum.
// //
// String presentation is Base58 Check Encoded string. // String presentation is [Base58
// Check](https://en.bitcoin.it/wiki/Base58Check_encoding) Encoded string.
//
// JSON value will be the data encoded as a string using standard base64
// encoding with paddings. Either
// [standard](https://tools.ietf.org/html/rfc4648#section-4) or
// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding
// with/without paddings are accepted.
message OwnerID { message OwnerID {
// Identifier of the container owner in a binary format // Identifier of the container owner in a binary format
bytes value = 1 [json_name = "value"]; bytes value = 1 [json_name = "value"];