From 10302dd4b1d9e27cd7f2822a4f7c8f80c9a16946 Mon Sep 17 00:00:00 2001 From: xethyrion Date: Tue, 21 Feb 2017 21:04:06 +0200 Subject: [PATCH] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e2ddacc..d38ea91 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ multiaddr for IPFS in C. #### All you need to include is multiaddr.h ## Maddr struct: * char * string; // String that contains addresses such as /ip4/192.168.1.1/ -* uint8_t bytes; //String that contains the enecoded address -* size_t bsize; //int[1] that contains the real bytes size (Use it whenever using the bytes so you don't input trash!) +* uint8_t * bytes; // uint8_t * that contains the enecoded address +* size_t bsize; //size_t that contains the real bytes size (Use it whenever using the bytes so you don't input trash!) ## New Multi Address From String(multiaddress_new_from_string) struct MultiAddress* a = multiaddress_new_from_string("/ip4/127.0.0.1/tcp/8080/"); @@ -18,7 +18,7 @@ struct MultiAddress* a = multiaddress_new_from_string("/ip4/127.0.0.1/tcp/8080/" ## Encapsulation & Decapsulation(m_encapsulate, m_decapsulate) #### Remember, Decapsulation happens from right to left, never in reverse, if you have /ip4/udp/ipfs/ if you decapsulate "udp" you will also take out ipfs! * Now the string is: /ip4/192.168.1.1/ -* multiaddress_encapsulate(a,"/udp/3333/"); //Adds udp/3333/ to char addrstr +* multiaddress_encapsulate(a,"/udp/3333/"); //Adds udp/3333/ * Now the string is: /ip4/192.168.1.1/udp/3333/ * multiaddress_decapsulate(a,"udp"); //Removes udp protocol and its address * Now the string is: /ip4/192.168.1.1/