0

I want a function like this:

uint64 sign(String s) {
    // how to signature a string
}

For use, this function can accept any string and return a signature. For example,

uint64 a = sign("hello world")

This function should signature a string just depending on its plain text but not memory location. And, different string text should generate different uint64 values.

Murat Karagöz
  • 35,401
  • 16
  • 78
  • 107
formath
  • 319
  • 3
  • 17
  • 4
    What you are looking for is usually called a hash function. See for example http://stackoverflow.com/questions/7666509/hash-function-for-string. – nucleon Jun 01 '16 at 11:06
  • 3
    Different strings should ALWAYS generate different uint64 values? This isn't really possible. Think about how many different strings there are, and how many different uint64s there are. – Dawood ibn Kareem Jun 01 '16 at 11:08

0 Answers0