github.com/hyperledger/burrow@v0.34.5-0.20220512172541-77f09336001d/binary/word160.go (about)

     1  package binary
     2  
     3  const Word160Length = 20
     4  const Word256Word160Delta = 12
     5  
     6  var Zero160 = Word160{}
     7  
     8  type Word160 [Word160Length]byte
     9  
    10  // Pad a Word160 on the left and embed it in a Word256 (as it is for account addresses in EVM)
    11  func (w Word160) Word256() (word256 Word256) {
    12  	copy(word256[Word256Word160Delta:], w[:])
    13  	return
    14  }
    15  
    16  func (w Word160) Bytes() []byte {
    17  	return w[:]
    18  }