github.com/ledgerwatch/erigon-lib@v1.0.0/common/length/length.go (about)

     1  /*
     2     Copyright 2021 Erigon contributors
     3  
     4     Licensed under the Apache License, Version 2.0 (the "License");
     5     you may not use this file except in compliance with the License.
     6     You may obtain a copy of the License at
     7  
     8         http://www.apache.org/licenses/LICENSE-2.0
     9  
    10     Unless required by applicable law or agreed to in writing, software
    11     distributed under the License is distributed on an "AS IS" BASIS,
    12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13     See the License for the specific language governing permissions and
    14     limitations under the License.
    15  */
    16  
    17  package length
    18  
    19  // Lengths of hashes and addresses in bytes.
    20  const (
    21  	PeerID = 64
    22  	// Hash is the expected length of the hash (in bytes)
    23  	Hash = 32
    24  	// expected length of Bytes96 (signature)
    25  	Bytes96 = 96
    26  	// expected length of Bytes48 (bls public key and such)
    27  	Bytes48 = 48
    28  	// expected length of Bytes64 (sync committee bits)
    29  	Bytes64 = 64
    30  	// expected length of Bytes48 (beacon domain and such)
    31  	Bytes4 = 4
    32  	// Addr is the expected length of the address (in bytes)
    33  	Addr = 20
    34  	// BlockNumberLen length of uint64 big endian
    35  	BlockNum = 8
    36  	// Ts TimeStamp (BlockNum, TxNum or any other uint64 equivalent of Time)
    37  	Ts = 8
    38  	// Incarnation length of uint64 for contract incarnations
    39  	Incarnation = 8
    40  )