Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/platisd/netstrings
A simple library to decode and encode Netstrings
https://github.com/platisd/netstrings
Last synced: about 1 month ago
JSON representation
A simple library to decode and encode Netstrings
- Host: GitHub
- URL: https://github.com/platisd/netstrings
- Owner: platisd
- License: apache-2.0
- Created: 2015-03-10T00:07:41.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-03-11T13:29:21.000Z (over 9 years ago)
- Last Synced: 2023-03-23T01:47:02.056Z (over 1 year ago)
- Language: C++
- Size: 161 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Netstrings
A simple Arduino library to decode and encode Netstrings by Dimitris Platis.
C++ version included in /cpp by David Jensen.## Introduction
This library allows easy decoding and encoding of Netstrings. For more information on Netstrings refer to http://cr.yp.to/proto/netstrings.txt## API
### String encodedNetstring(String plainInput)
Provide an input in plain text to this function and it will return a Netstring. The string "error" will be returned, if an empty string is supplied.
* **Example**
```arduino
String netstring = encodedNetstring("send this as a netstring");
//nestring == 24:send this as a netstring,
```### String decodedNetstring(String netstring)
Provide an input encoded as a Netstring and if the Netstring is valid, this function will return the string that was used to generate the Netstring. If the supplied Netstring is not valid, then an "error" string is returned.* **Example**
```arduino
String plainInput = decodedNetstring("11:*@*#(SADASD,")
// plainInput == "*@*#(SADASD"
```