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 parts converted to bytes32. How can I concatenate the single bytes32 to restore the URL?
I know I can create a bytes array and set bytes at indexes. But I don't know how I can access a specific position in a bytes32.
function bytes2string(bytes32[] data) returns (string) {
bytes memory r = new bytes(1);
r[0] = bytes1(data[0]);
return string(r);
}