Netstring encoding and decoding functions for shell scripts.
These functions operate over stdin
and stdout
so that NULL
bytes are
not lost in the process.
#!/usr/bin/env import
import "[email protected]"
printf "12:hello world!," | netstring_decode
# hello world!
printf "hello world!" | netstring_encode
# 12:hello world!,