Questions tagged [signature]

In computer programming, especially object-oriented programming, a method is commonly identified by its unique method signature, which usually includes the method name, and the number, types and order of its parameters. A method signature is the smallest type of a method. The signature tag should not be used to tag questions about digital signatures, email signatures or written signatures.

Method signature

In computer programming, especially object-oriented programming, a method is commonly identified by its unique method signature, which usually includes the method name, and the number, types and order of its parameters. A method signature is the smallest type of a method.

Method overloading

Method signatures can be used by the compiler to distinguish between methods with the same name, but with different parameters. This is called method overloading. The precise characteristics of method overloading depends on the programming language. Overloading should not be used for methods that perform an different operation as that will make the source code hard to read.

Examples

Example of declarations of two overloaded methods with the same name, but with a different method signature:

void drawPoint(int x, int y);
void drawPoint(Point p);

in this case it is likely that drawPoint(x, y) internally converts x and y into a Point instance. This kind of function is therefore called a convenience method.

Disambiguation

For digital signatures such as RSA or DSA signatures please use and/or . Email may contain an email-signature, PDF documents may contain a digitized written signature. These signatures don't have specialized tags, please use more generic tags such as and instead.

2003 questions
7
votes
1 answer

Invalid signature error from ethers when trying to verify a Smart Contract Wallet(account abstraction) signature

I am working on a dapp that needs to verify users' signatures. When testing with Metamask, everything is okay. When trying to verify a signature from Ambire wallet, I get "Error: invalid signature string" from ethers.utils.verifyMessage For example,…
whd
  • 1,819
  • 1
  • 21
  • 52
7
votes
1 answer

How to make line breaks in long function signature and format it prettily in Sphinx autodoc

I have a function with a long signature with type hint, like def set_parameters( tokenizer: Union[None, "Tokenizer", str] = None, vocab: Optional["Vocab"] = None, vocab_from: Optional[Dict[str, str]] = None, …
7
votes
3 answers

How to add Signature in flutter?

I have implemented signature_pad in my flutter project and it works fine. Unfortunately when I place it inside SingleChildScrollView, the signature was not drawn. It scrolled instead of signed. It seems like is the GestureDetector but I have no idea…
Hoo
  • 1,806
  • 7
  • 33
  • 66
7
votes
1 answer

Multiple MAIN signatures

I have a package with multiple main and I want to define several options: My code is something like this: package Perl6::Documentable::CLI { proto MAIN(|) is export {*} my %*SUB-MAIN-OPTS = :named-everywhere; multi MAIN( …
Antonio Gamiz Delgado
  • 1,871
  • 1
  • 12
  • 33
7
votes
1 answer

How exactly does inspect.signature work with classes?

The inspect.signature doc states that it supports classes as input, but it doesn't go into any sort of detail: Accepts a wide range of Python callables, from plain functions and classes to functools.partial() objects. If I call…
Aran-Fey
  • 39,665
  • 11
  • 104
  • 149
7
votes
2 answers

Can RSA be both used as encryption and signature?

I am sorry but my mind suddenly goes blank for this question.... EDIT (Scenario) If I want information to bypass simple filters like f-ck, is it OK to encrypt the information with public key, and sign by private key? The public key may have already…
Dante May Code
  • 11,177
  • 9
  • 49
  • 81
7
votes
1 answer

OCaml Modules: bringing (interconnected) types from different modules into a new module

The problem One problem I'm having is bringing the types and vals of two module into a new combined module. I'll give an example. Currently I have the following two type signatures module type Ordered = sig type t (* the type of elements which…
Surikator
  • 1,463
  • 9
  • 26
7
votes
1 answer

Create `signature area` for mobile app in dart (flutter)

i want to create a signature area like Here with dart in a mobile app! I tried to use the CustomPaint class ... But it doesn't work. Can anyone help me?
Jona
  • 273
  • 1
  • 2
  • 5
7
votes
2 answers

Default Argument decorator python

Python 3.6 I'm attempting to create a decorator that automatically assigns the string of the argument as the default value. such as: def example(one='one', two='two', three='three'): pass would be equivalent to: @DefaultArguments def…
James Schinner
  • 1,549
  • 18
  • 28
7
votes
1 answer

How to reuse a signature?

Is it possible to assign a signature to a variable and then reuse it in different functions/methods? I've found my $sig = :($a, $b); but I don't know how I could use the variable as a signature in a function.
sid_com
  • 24,137
  • 26
  • 96
  • 187
7
votes
4 answers

Android studio : Can not choose signature version

I want to build my app with V1 & V2 signature version. But both of them are greyed out. Can anyone please tell me how to make it avaiable to choose? [generate signature]
snow2102
  • 101
  • 1
  • 1
  • 2
7
votes
4 answers

Copy signature, forward all arguments from wrapper function

I have two functions in a class, plot() and show(). show(), as convenience method, does nothing else than to add two lines to the code of plot() like def plot( self, show_this=True, show_that=True, color='k', …
Nico Schlömer
  • 53,797
  • 27
  • 201
  • 249
7
votes
2 answers

Generating, Signing and Verifying Digital Signature

So here's a question from my project. In this task, we will use OpenSSL to generate digital signatures. Please prepare a file (example.txt) of any size. Also prepare an RSA public/private key pair. Then do the following: Sign the SHA256 hash of…
Data Shark
  • 91
  • 1
  • 1
  • 7
7
votes
0 answers

Different results between System.Security.SignedCms and BouncyCastle CmsSignedDataGenerator

I need make pksc#7 signature. It's my working (time to time) code with SignedCms: public static string SignSignedCms(string data) { byte[] bData = Encoding.UTF8.GetBytes(data); X509Certificate2 certificate = new X509Certificate2(); …
7
votes
2 answers

Sign PowerShell script on non-Windows platform?

I'm working on a project where we are remotely deploying software using a configuration management, part of which delivers PowerShell scripts to Windows servers, which are then executed in order to perform parts of our setup and/or configuration.…