Encode binary files to printable utf16be. See more at https://github.com/fumiama/base16384. Signed-off-by: 源 文雨 <fumiama@foxmail.com>
15 lines
321 B
Bash
15 lines
321 B
Bash
#!/bin/sh
|
|
|
|
case "$1" in
|
|
"base16384")
|
|
i=1
|
|
while [ $i -le 100 ]; do
|
|
s="$(head /dev/urandom | head -c $i)"
|
|
if [ "$(echo $s)" != "$(echo $s | base16384 -e - - | base16384 -d - -)" ]; then
|
|
exit $i
|
|
fi
|
|
i=$( expr $i + 1 )
|
|
done
|
|
esac
|
|
|
|
exit 0
|