code: func DecodePacketNumber(
  	packetNumberLength PacketNumberLen,
  	lastPacketNumber PacketNumber,
  	wirePacketNumber PacketNumber,
  ) PacketNumber {
  	var epochDelta PacketNumber
  	switch packetNumberLength {
  	case PacketNumberLen1:
  		epochDelta = PacketNumber(1) << 8
  	case PacketNumberLen2:
  		epochDelta = PacketNumber(1) << 16
  	case PacketNumberLen3:
  		epochDelta = PacketNumber(1) << 24
  	case PacketNumberLen4:
  		epochDelta = PacketNumber(1) << 32
  	}
  	epoch := lastPacketNumber & ^(epochDelta - 1)
  	prevEpochBegin := epoch - epochDelta
  	nextEpochBegin := epoch + epochDelta
  	return closestTo(
  		lastPacketNumber+1,
  		epoch+wirePacketNumber,
  		closestTo(lastPacketNumber+1, prevEpochBegin+wirePacketNumber, nextEpochBegin+wirePacketNumber),
  	)
  }
docs: // DecodePacketNumber calculates the packet number based on the received packet number, its length and the last seen packet number