code: func TextAndHash(data []byte) ([]byte, string) {
  	msg := fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(data), string(data))
  	hasher := sha3.NewLegacyKeccak256()
  	hasher.Write([]byte(msg))
  	return hasher.Sum(nil), msg
  }
docs: // TextAndHash is a helper function that calculates a hash for the given message that can be
  // safely used to calculate a signature from.
  //
  // The hash is calulcated as
  //   keccak256("\x19Ethereum Signed Message:\n"${message length}${message}).
  //
  // This gives context to the signed message and prevents signing of transactions.