Linked Questions
20 questions linked to/from How to convert a bytes32 to string
1
vote
2
answers
4k
views
How to convert bytes32 to string? [duplicate]
I input an string data as bytes32 type. Now i cannot return that string in readable form? any way to do that?
0
votes
1
answer
270
views
Can bytes32 be changed to a string in solidity? [duplicate]
I was wondering if it is possible to convert a bytes32 to a string in solidity like this,
I want an input bytes32 input = 0x74657374
and an output of string output = "0x74657374"
54
votes
8
answers
31k
views
How to quickly test a Solidity function?
There are snippets and functions of Solidity code provided on this Ethereum Stack Exchange and other sites. What are ways to quickly test them, possibly debug a little, and play around?
39
votes
5
answers
46k
views
Convert address to string
In Solidity, how can I convert the sender address to a string?
The comments in
How to convert an address to bytes in Solidity? did not provide a working solution
23
votes
5
answers
40k
views
Conversion of uint to string
I am trying to convert uint to string in solidity. Is it possible to convert? if so how can I convert it?
Convertion to base 10 is prefered, but in hexadecimal might also be helpful.
13
votes
4
answers
10k
views
How to convert byte array to bytes32 in solidity
I want to know the syntax to convert a byte array to bytes32 in solidity.
This is a follow up to the question- How to store Public Key in Ethereum contract?
I want to retrieve the PublicKey stored ...
9
votes
2
answers
8k
views
How to concatenate a bytes32[] array to a string?
I am passing an array of bytes32 to my function. This array can contain numbers or hashes etc. to identify an object. In a new use case I want to pass a URL to this function by splitting the URL into ...
7
votes
3
answers
12k
views
Getting infinite gas estimates for simple functions
I am testing out solidity in remix ide using simple contracts. This is the contract that I wrote:
contract mortal {
address owner;
function mortal() {
owner = msg.sender;
}
function kill(){
...
11
votes
1
answer
5k
views
Error when using string type as a mapping key
The following code doesn't compile, because compiler needs a mapping key to be of fixed-size type in order to create accessor for a public mapping. I'm using here string type. My strings are 24 byte ...
4
votes
3
answers
6k
views
Keccak256(parameter) How to pass a string to be hashed?
I'm trying to do something that in theory is very simple: I want to pass a string like "hello" to a function and then compute the sha3/keccak256 hash.
I think the problem is that if the parameter is a ...
6
votes
1
answer
3k
views
How to join strings with numbers in Solidity
I'd like to format url with number parameters as following:
http://someurl.com/?param1=100¶m2=200
The problem is, it's always truncated after first number parameter e.g:
http://someurl.com/...
4
votes
2
answers
2k
views
Solidity return string not hex?
Currently I'm using ether.camp to create a contract. At this stage it simply gets and stores some values. However when I try and get the values they are in bytes/hex even though the return type is ...
2
votes
3
answers
1k
views
Compare bytes32 and string using solidity
I need to compare a bytes32 value with a string. In the below example I need to check if QRVal==QRScanVal.
Eg: bytes32 QRVal="0xc59aa6848d32d073bdcaa041b2735d3e4546d0836498e30de7c4c64c50933a33";
...
3
votes
2
answers
706
views
Convertion from bytes 8,16,32 to String
I know it has been asked a lot of times but the newest post about this I could find was about 1 year old. To me it seems quite possible that things have changed since then. So my question: Is there an ...
2
votes
3
answers
1k
views
Solidity return array from struct
I use solidity with web3.js and know that we actually cannot return the whole struct array, but I would like to know if it is possible to return only a type in the struct as an array.
Lets say i have ...