1ffe3c632Sopenharmony_ci// Protocol Buffers - Google's data interchange format 2ffe3c632Sopenharmony_ci// Copyright 2008 Google Inc. All rights reserved. 3ffe3c632Sopenharmony_ci// https://developers.google.com/protocol-buffers/ 4ffe3c632Sopenharmony_ci// 5ffe3c632Sopenharmony_ci// Redistribution and use in source and binary forms, with or without 6ffe3c632Sopenharmony_ci// modification, are permitted provided that the following conditions are 7ffe3c632Sopenharmony_ci// met: 8ffe3c632Sopenharmony_ci// 9ffe3c632Sopenharmony_ci// * Redistributions of source code must retain the above copyright 10ffe3c632Sopenharmony_ci// notice, this list of conditions and the following disclaimer. 11ffe3c632Sopenharmony_ci// * Redistributions in binary form must reproduce the above 12ffe3c632Sopenharmony_ci// copyright notice, this list of conditions and the following disclaimer 13ffe3c632Sopenharmony_ci// in the documentation and/or other materials provided with the 14ffe3c632Sopenharmony_ci// distribution. 15ffe3c632Sopenharmony_ci// * Neither the name of Google Inc. nor the names of its 16ffe3c632Sopenharmony_ci// contributors may be used to endorse or promote products derived from 17ffe3c632Sopenharmony_ci// this software without specific prior written permission. 18ffe3c632Sopenharmony_ci// 19ffe3c632Sopenharmony_ci// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20ffe3c632Sopenharmony_ci// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21ffe3c632Sopenharmony_ci// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22ffe3c632Sopenharmony_ci// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23ffe3c632Sopenharmony_ci// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24ffe3c632Sopenharmony_ci// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25ffe3c632Sopenharmony_ci// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26ffe3c632Sopenharmony_ci// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27ffe3c632Sopenharmony_ci// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28ffe3c632Sopenharmony_ci// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29ffe3c632Sopenharmony_ci// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30ffe3c632Sopenharmony_ci 31ffe3c632Sopenharmony_ci/** 32ffe3c632Sopenharmony_ci * @fileoverview This file contains constants and typedefs used by 33ffe3c632Sopenharmony_ci * jspb.BinaryReader and BinaryWriter. 34ffe3c632Sopenharmony_ci * 35ffe3c632Sopenharmony_ci * @author aappleby@google.com (Austin Appleby) 36ffe3c632Sopenharmony_ci */ 37ffe3c632Sopenharmony_ci 38ffe3c632Sopenharmony_cigoog.provide('jspb.AnyFieldType'); 39ffe3c632Sopenharmony_cigoog.provide('jspb.BinaryConstants'); 40ffe3c632Sopenharmony_cigoog.provide('jspb.BinaryMessage'); 41ffe3c632Sopenharmony_cigoog.provide('jspb.BuilderFunction'); 42ffe3c632Sopenharmony_cigoog.provide('jspb.ByteSource'); 43ffe3c632Sopenharmony_cigoog.provide('jspb.ClonerFunction'); 44ffe3c632Sopenharmony_cigoog.provide('jspb.ComparerFunction'); 45ffe3c632Sopenharmony_cigoog.provide('jspb.ConstBinaryMessage'); 46ffe3c632Sopenharmony_cigoog.provide('jspb.PrunerFunction'); 47ffe3c632Sopenharmony_cigoog.provide('jspb.ReaderFunction'); 48ffe3c632Sopenharmony_cigoog.provide('jspb.RecyclerFunction'); 49ffe3c632Sopenharmony_cigoog.provide('jspb.RepeatedFieldType'); 50ffe3c632Sopenharmony_cigoog.provide('jspb.ScalarFieldType'); 51ffe3c632Sopenharmony_cigoog.provide('jspb.WriterFunction'); 52ffe3c632Sopenharmony_ci 53ffe3c632Sopenharmony_ci 54ffe3c632Sopenharmony_cigoog.forwardDeclare('jspb.BinaryMessage'); 55ffe3c632Sopenharmony_cigoog.forwardDeclare('jspb.BinaryReader'); 56ffe3c632Sopenharmony_cigoog.forwardDeclare('jspb.BinaryWriter'); 57ffe3c632Sopenharmony_cigoog.forwardDeclare('jspb.Message'); 58ffe3c632Sopenharmony_cigoog.forwardDeclare('jsprotolib.BinaryExtension'); 59ffe3c632Sopenharmony_ci 60ffe3c632Sopenharmony_ci 61ffe3c632Sopenharmony_ci 62ffe3c632Sopenharmony_ci/** 63ffe3c632Sopenharmony_ci * Base interface class for all const messages. 64ffe3c632Sopenharmony_ci * @interface 65ffe3c632Sopenharmony_ci */ 66ffe3c632Sopenharmony_cijspb.ConstBinaryMessage = function() {}; 67ffe3c632Sopenharmony_ci 68ffe3c632Sopenharmony_ci/** 69ffe3c632Sopenharmony_ci * Generate a debug string for this proto that is in proto2 text format. 70ffe3c632Sopenharmony_ci * @return {string} The debug string. 71ffe3c632Sopenharmony_ci */ 72ffe3c632Sopenharmony_cijspb.ConstBinaryMessage.prototype.toDebugString; 73ffe3c632Sopenharmony_ci 74ffe3c632Sopenharmony_ci/** 75ffe3c632Sopenharmony_ci * Helper to generate a debug string for this proto at some indent level. The 76ffe3c632Sopenharmony_ci * first line is not indented. 77ffe3c632Sopenharmony_ci * @param {number} indentLevel The number of spaces by which to indent lines. 78ffe3c632Sopenharmony_ci * @return {string} The debug string. 79ffe3c632Sopenharmony_ci * @protected 80ffe3c632Sopenharmony_ci */ 81ffe3c632Sopenharmony_cijspb.ConstBinaryMessage.prototype.toDebugStringInternal; 82ffe3c632Sopenharmony_ci 83ffe3c632Sopenharmony_ci/** 84ffe3c632Sopenharmony_ci * Base interface class for all messages. Does __not__ define any methods, as 85ffe3c632Sopenharmony_ci * doing so on a widely-used interface defeats dead-code elimination. 86ffe3c632Sopenharmony_ci * @interface 87ffe3c632Sopenharmony_ci * @extends {jspb.ConstBinaryMessage} 88ffe3c632Sopenharmony_ci */ 89ffe3c632Sopenharmony_cijspb.BinaryMessage = function() {}; 90ffe3c632Sopenharmony_ci 91ffe3c632Sopenharmony_ci 92ffe3c632Sopenharmony_ci/** 93ffe3c632Sopenharmony_ci * The types convertible to Uint8Arrays. Strings are assumed to be 94ffe3c632Sopenharmony_ci * base64-encoded. 95ffe3c632Sopenharmony_ci * @typedef {ArrayBuffer|Uint8Array|Array<number>|string} 96ffe3c632Sopenharmony_ci */ 97ffe3c632Sopenharmony_cijspb.ByteSource; 98ffe3c632Sopenharmony_ci 99ffe3c632Sopenharmony_ci 100ffe3c632Sopenharmony_ci/** 101ffe3c632Sopenharmony_ci * A scalar field in jspb can be a boolean, number, or string. 102ffe3c632Sopenharmony_ci * @typedef {boolean|number|string} 103ffe3c632Sopenharmony_ci */ 104ffe3c632Sopenharmony_cijspb.ScalarFieldType; 105ffe3c632Sopenharmony_ci 106ffe3c632Sopenharmony_ci 107ffe3c632Sopenharmony_ci/** 108ffe3c632Sopenharmony_ci * A repeated field in jspb is an array of scalars, blobs, or messages. 109ffe3c632Sopenharmony_ci * @typedef {!Array<jspb.ScalarFieldType>| 110ffe3c632Sopenharmony_ci !Array<!Uint8Array>| 111ffe3c632Sopenharmony_ci !Array<!jspb.ConstBinaryMessage>| 112ffe3c632Sopenharmony_ci !Array<!jspb.BinaryMessage>} 113ffe3c632Sopenharmony_ci */ 114ffe3c632Sopenharmony_cijspb.RepeatedFieldType; 115ffe3c632Sopenharmony_ci 116ffe3c632Sopenharmony_ci 117ffe3c632Sopenharmony_ci/** 118ffe3c632Sopenharmony_ci * A field in jspb can be a scalar, a block of bytes, another proto, or an 119ffe3c632Sopenharmony_ci * array of any of the above. 120ffe3c632Sopenharmony_ci * @typedef {jspb.ScalarFieldType| 121ffe3c632Sopenharmony_ci jspb.RepeatedFieldType| 122ffe3c632Sopenharmony_ci !Uint8Array| 123ffe3c632Sopenharmony_ci !jspb.ConstBinaryMessage| 124ffe3c632Sopenharmony_ci !jspb.BinaryMessage| 125ffe3c632Sopenharmony_ci !jsprotolib.BinaryExtension} 126ffe3c632Sopenharmony_ci */ 127ffe3c632Sopenharmony_cijspb.AnyFieldType; 128ffe3c632Sopenharmony_ci 129ffe3c632Sopenharmony_ci 130ffe3c632Sopenharmony_ci/** 131ffe3c632Sopenharmony_ci * A builder function creates an instance of a message object. 132ffe3c632Sopenharmony_ci * @typedef {function():!jspb.BinaryMessage} 133ffe3c632Sopenharmony_ci */ 134ffe3c632Sopenharmony_cijspb.BuilderFunction; 135ffe3c632Sopenharmony_ci 136ffe3c632Sopenharmony_ci 137ffe3c632Sopenharmony_ci/** 138ffe3c632Sopenharmony_ci * A cloner function creates a deep copy of a message object. 139ffe3c632Sopenharmony_ci * @typedef {function(jspb.ConstBinaryMessage):jspb.BinaryMessage} 140ffe3c632Sopenharmony_ci */ 141ffe3c632Sopenharmony_cijspb.ClonerFunction; 142ffe3c632Sopenharmony_ci 143ffe3c632Sopenharmony_ci 144ffe3c632Sopenharmony_ci/** 145ffe3c632Sopenharmony_ci * A recycler function destroys an instance of a message object. 146ffe3c632Sopenharmony_ci * @typedef {function(!jspb.BinaryMessage):void} 147ffe3c632Sopenharmony_ci */ 148ffe3c632Sopenharmony_cijspb.RecyclerFunction; 149ffe3c632Sopenharmony_ci 150ffe3c632Sopenharmony_ci 151ffe3c632Sopenharmony_ci/** 152ffe3c632Sopenharmony_ci * A reader function initializes a message using data from a BinaryReader. 153ffe3c632Sopenharmony_ci * @typedef {function(!jspb.BinaryMessage, !jspb.BinaryReader):void} 154ffe3c632Sopenharmony_ci */ 155ffe3c632Sopenharmony_cijspb.ReaderFunction; 156ffe3c632Sopenharmony_ci 157ffe3c632Sopenharmony_ci 158ffe3c632Sopenharmony_ci/** 159ffe3c632Sopenharmony_ci * A writer function serializes a message to a BinaryWriter. 160ffe3c632Sopenharmony_ci * @typedef {function((!jspb.Message|!jspb.ConstBinaryMessage), 161ffe3c632Sopenharmony_ci * !jspb.BinaryWriter):void} 162ffe3c632Sopenharmony_ci */ 163ffe3c632Sopenharmony_cijspb.WriterFunction; 164ffe3c632Sopenharmony_ci 165ffe3c632Sopenharmony_ci 166ffe3c632Sopenharmony_ci/** 167ffe3c632Sopenharmony_ci * A pruner function removes default-valued fields and empty submessages from a 168ffe3c632Sopenharmony_ci * message and returns either the pruned message or null if the entire message 169ffe3c632Sopenharmony_ci * was pruned away. 170ffe3c632Sopenharmony_ci * @typedef {function(?jspb.BinaryMessage):?jspb.BinaryMessage} 171ffe3c632Sopenharmony_ci */ 172ffe3c632Sopenharmony_cijspb.PrunerFunction; 173ffe3c632Sopenharmony_ci 174ffe3c632Sopenharmony_ci 175ffe3c632Sopenharmony_ci/** 176ffe3c632Sopenharmony_ci * A comparer function returns true if two protos are equal. 177ffe3c632Sopenharmony_ci * @typedef {function(?jspb.ConstBinaryMessage, 178ffe3c632Sopenharmony_ci * ?jspb.ConstBinaryMessage):boolean} 179ffe3c632Sopenharmony_ci */ 180ffe3c632Sopenharmony_cijspb.ComparerFunction; 181ffe3c632Sopenharmony_ci 182ffe3c632Sopenharmony_ci 183ffe3c632Sopenharmony_ci/** 184ffe3c632Sopenharmony_ci * Field type codes, taken from proto2/public/wire_format_lite.h. 185ffe3c632Sopenharmony_ci * @enum {number} 186ffe3c632Sopenharmony_ci */ 187ffe3c632Sopenharmony_cijspb.BinaryConstants.FieldType = { 188ffe3c632Sopenharmony_ci INVALID: -1, 189ffe3c632Sopenharmony_ci DOUBLE: 1, 190ffe3c632Sopenharmony_ci FLOAT: 2, 191ffe3c632Sopenharmony_ci INT64: 3, 192ffe3c632Sopenharmony_ci UINT64: 4, 193ffe3c632Sopenharmony_ci INT32: 5, 194ffe3c632Sopenharmony_ci FIXED64: 6, 195ffe3c632Sopenharmony_ci FIXED32: 7, 196ffe3c632Sopenharmony_ci BOOL: 8, 197ffe3c632Sopenharmony_ci STRING: 9, 198ffe3c632Sopenharmony_ci GROUP: 10, 199ffe3c632Sopenharmony_ci MESSAGE: 11, 200ffe3c632Sopenharmony_ci BYTES: 12, 201ffe3c632Sopenharmony_ci UINT32: 13, 202ffe3c632Sopenharmony_ci ENUM: 14, 203ffe3c632Sopenharmony_ci SFIXED32: 15, 204ffe3c632Sopenharmony_ci SFIXED64: 16, 205ffe3c632Sopenharmony_ci SINT32: 17, 206ffe3c632Sopenharmony_ci SINT64: 18, 207ffe3c632Sopenharmony_ci 208ffe3c632Sopenharmony_ci // Extended types for Javascript 209ffe3c632Sopenharmony_ci 210ffe3c632Sopenharmony_ci FHASH64: 30, // 64-bit hash string, fixed-length encoding. 211ffe3c632Sopenharmony_ci VHASH64: 31 // 64-bit hash string, varint encoding. 212ffe3c632Sopenharmony_ci}; 213ffe3c632Sopenharmony_ci 214ffe3c632Sopenharmony_ci 215ffe3c632Sopenharmony_ci/** 216ffe3c632Sopenharmony_ci * Wire-format type codes, taken from proto2/public/wire_format_lite.h. 217ffe3c632Sopenharmony_ci * @enum {number} 218ffe3c632Sopenharmony_ci */ 219ffe3c632Sopenharmony_cijspb.BinaryConstants.WireType = { 220ffe3c632Sopenharmony_ci INVALID: -1, 221ffe3c632Sopenharmony_ci VARINT: 0, 222ffe3c632Sopenharmony_ci FIXED64: 1, 223ffe3c632Sopenharmony_ci DELIMITED: 2, 224ffe3c632Sopenharmony_ci START_GROUP: 3, 225ffe3c632Sopenharmony_ci END_GROUP: 4, 226ffe3c632Sopenharmony_ci FIXED32: 5 227ffe3c632Sopenharmony_ci}; 228ffe3c632Sopenharmony_ci 229ffe3c632Sopenharmony_ci 230ffe3c632Sopenharmony_ci/** 231ffe3c632Sopenharmony_ci * Translates field type to wire type. 232ffe3c632Sopenharmony_ci * @param {jspb.BinaryConstants.FieldType} fieldType 233ffe3c632Sopenharmony_ci * @return {jspb.BinaryConstants.WireType} 234ffe3c632Sopenharmony_ci */ 235ffe3c632Sopenharmony_cijspb.BinaryConstants.FieldTypeToWireType = function(fieldType) { 236ffe3c632Sopenharmony_ci var fieldTypes = jspb.BinaryConstants.FieldType; 237ffe3c632Sopenharmony_ci var wireTypes = jspb.BinaryConstants.WireType; 238ffe3c632Sopenharmony_ci switch (fieldType) { 239ffe3c632Sopenharmony_ci case fieldTypes.INT32: 240ffe3c632Sopenharmony_ci case fieldTypes.INT64: 241ffe3c632Sopenharmony_ci case fieldTypes.UINT32: 242ffe3c632Sopenharmony_ci case fieldTypes.UINT64: 243ffe3c632Sopenharmony_ci case fieldTypes.SINT32: 244ffe3c632Sopenharmony_ci case fieldTypes.SINT64: 245ffe3c632Sopenharmony_ci case fieldTypes.BOOL: 246ffe3c632Sopenharmony_ci case fieldTypes.ENUM: 247ffe3c632Sopenharmony_ci case fieldTypes.VHASH64: 248ffe3c632Sopenharmony_ci return wireTypes.VARINT; 249ffe3c632Sopenharmony_ci 250ffe3c632Sopenharmony_ci case fieldTypes.DOUBLE: 251ffe3c632Sopenharmony_ci case fieldTypes.FIXED64: 252ffe3c632Sopenharmony_ci case fieldTypes.SFIXED64: 253ffe3c632Sopenharmony_ci case fieldTypes.FHASH64: 254ffe3c632Sopenharmony_ci return wireTypes.FIXED64; 255ffe3c632Sopenharmony_ci 256ffe3c632Sopenharmony_ci case fieldTypes.STRING: 257ffe3c632Sopenharmony_ci case fieldTypes.MESSAGE: 258ffe3c632Sopenharmony_ci case fieldTypes.BYTES: 259ffe3c632Sopenharmony_ci return wireTypes.DELIMITED; 260ffe3c632Sopenharmony_ci 261ffe3c632Sopenharmony_ci case fieldTypes.FLOAT: 262ffe3c632Sopenharmony_ci case fieldTypes.FIXED32: 263ffe3c632Sopenharmony_ci case fieldTypes.SFIXED32: 264ffe3c632Sopenharmony_ci return wireTypes.FIXED32; 265ffe3c632Sopenharmony_ci 266ffe3c632Sopenharmony_ci case fieldTypes.INVALID: 267ffe3c632Sopenharmony_ci case fieldTypes.GROUP: 268ffe3c632Sopenharmony_ci default: 269ffe3c632Sopenharmony_ci return wireTypes.INVALID; 270ffe3c632Sopenharmony_ci } 271ffe3c632Sopenharmony_ci}; 272ffe3c632Sopenharmony_ci 273ffe3c632Sopenharmony_ci 274ffe3c632Sopenharmony_ci/** 275ffe3c632Sopenharmony_ci * Flag to indicate a missing field. 276ffe3c632Sopenharmony_ci * @const {number} 277ffe3c632Sopenharmony_ci */ 278ffe3c632Sopenharmony_cijspb.BinaryConstants.INVALID_FIELD_NUMBER = -1; 279ffe3c632Sopenharmony_ci 280ffe3c632Sopenharmony_ci 281ffe3c632Sopenharmony_ci/** 282ffe3c632Sopenharmony_ci * The smallest denormal float32 value. 283ffe3c632Sopenharmony_ci * @const {number} 284ffe3c632Sopenharmony_ci */ 285ffe3c632Sopenharmony_cijspb.BinaryConstants.FLOAT32_EPS = 1.401298464324817e-45; 286ffe3c632Sopenharmony_ci 287ffe3c632Sopenharmony_ci 288ffe3c632Sopenharmony_ci/** 289ffe3c632Sopenharmony_ci * The smallest normal float64 value. 290ffe3c632Sopenharmony_ci * @const {number} 291ffe3c632Sopenharmony_ci */ 292ffe3c632Sopenharmony_cijspb.BinaryConstants.FLOAT32_MIN = 1.1754943508222875e-38; 293ffe3c632Sopenharmony_ci 294ffe3c632Sopenharmony_ci 295ffe3c632Sopenharmony_ci/** 296ffe3c632Sopenharmony_ci * The largest finite float32 value. 297ffe3c632Sopenharmony_ci * @const {number} 298ffe3c632Sopenharmony_ci */ 299ffe3c632Sopenharmony_cijspb.BinaryConstants.FLOAT32_MAX = 3.4028234663852886e+38; 300ffe3c632Sopenharmony_ci 301ffe3c632Sopenharmony_ci 302ffe3c632Sopenharmony_ci/** 303ffe3c632Sopenharmony_ci * The smallest denormal float64 value. 304ffe3c632Sopenharmony_ci * @const {number} 305ffe3c632Sopenharmony_ci */ 306ffe3c632Sopenharmony_cijspb.BinaryConstants.FLOAT64_EPS = 5e-324; 307ffe3c632Sopenharmony_ci 308ffe3c632Sopenharmony_ci 309ffe3c632Sopenharmony_ci/** 310ffe3c632Sopenharmony_ci * The smallest normal float64 value. 311ffe3c632Sopenharmony_ci * @const {number} 312ffe3c632Sopenharmony_ci */ 313ffe3c632Sopenharmony_cijspb.BinaryConstants.FLOAT64_MIN = 2.2250738585072014e-308; 314ffe3c632Sopenharmony_ci 315ffe3c632Sopenharmony_ci 316ffe3c632Sopenharmony_ci/** 317ffe3c632Sopenharmony_ci * The largest finite float64 value. 318ffe3c632Sopenharmony_ci * @const {number} 319ffe3c632Sopenharmony_ci */ 320ffe3c632Sopenharmony_cijspb.BinaryConstants.FLOAT64_MAX = 1.7976931348623157e+308; 321ffe3c632Sopenharmony_ci 322ffe3c632Sopenharmony_ci 323ffe3c632Sopenharmony_ci/** 324ffe3c632Sopenharmony_ci * Convenience constant equal to 2^20. 325ffe3c632Sopenharmony_ci * @const {number} 326ffe3c632Sopenharmony_ci */ 327ffe3c632Sopenharmony_cijspb.BinaryConstants.TWO_TO_20 = 1048576; 328ffe3c632Sopenharmony_ci 329ffe3c632Sopenharmony_ci 330ffe3c632Sopenharmony_ci/** 331ffe3c632Sopenharmony_ci * Convenience constant equal to 2^23. 332ffe3c632Sopenharmony_ci * @const {number} 333ffe3c632Sopenharmony_ci */ 334ffe3c632Sopenharmony_cijspb.BinaryConstants.TWO_TO_23 = 8388608; 335ffe3c632Sopenharmony_ci 336ffe3c632Sopenharmony_ci 337ffe3c632Sopenharmony_ci/** 338ffe3c632Sopenharmony_ci * Convenience constant equal to 2^31. 339ffe3c632Sopenharmony_ci * @const {number} 340ffe3c632Sopenharmony_ci */ 341ffe3c632Sopenharmony_cijspb.BinaryConstants.TWO_TO_31 = 2147483648; 342ffe3c632Sopenharmony_ci 343ffe3c632Sopenharmony_ci 344ffe3c632Sopenharmony_ci/** 345ffe3c632Sopenharmony_ci * Convenience constant equal to 2^32. 346ffe3c632Sopenharmony_ci * @const {number} 347ffe3c632Sopenharmony_ci */ 348ffe3c632Sopenharmony_cijspb.BinaryConstants.TWO_TO_32 = 4294967296; 349ffe3c632Sopenharmony_ci 350ffe3c632Sopenharmony_ci 351ffe3c632Sopenharmony_ci/** 352ffe3c632Sopenharmony_ci * Convenience constant equal to 2^52. 353ffe3c632Sopenharmony_ci * @const {number} 354ffe3c632Sopenharmony_ci */ 355ffe3c632Sopenharmony_cijspb.BinaryConstants.TWO_TO_52 = 4503599627370496; 356ffe3c632Sopenharmony_ci 357ffe3c632Sopenharmony_ci 358ffe3c632Sopenharmony_ci/** 359ffe3c632Sopenharmony_ci * Convenience constant equal to 2^63. 360ffe3c632Sopenharmony_ci * @const {number} 361ffe3c632Sopenharmony_ci */ 362ffe3c632Sopenharmony_cijspb.BinaryConstants.TWO_TO_63 = 9223372036854775808; 363ffe3c632Sopenharmony_ci 364ffe3c632Sopenharmony_ci 365ffe3c632Sopenharmony_ci/** 366ffe3c632Sopenharmony_ci * Convenience constant equal to 2^64. 367ffe3c632Sopenharmony_ci * @const {number} 368ffe3c632Sopenharmony_ci */ 369ffe3c632Sopenharmony_cijspb.BinaryConstants.TWO_TO_64 = 18446744073709551616; 370ffe3c632Sopenharmony_ci 371ffe3c632Sopenharmony_ci 372ffe3c632Sopenharmony_ci/** 373ffe3c632Sopenharmony_ci * Eight-character string of zeros, used as the default 64-bit hash value. 374ffe3c632Sopenharmony_ci * @const {string} 375ffe3c632Sopenharmony_ci */ 376ffe3c632Sopenharmony_cijspb.BinaryConstants.ZERO_HASH = '\0\0\0\0\0\0\0\0'; 377