mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-23 07:34:31 +00:00
9 lines
270 B
Bash
9 lines
270 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
if [ ! -f "$1" ]; then
|
||
|
SEED=`od -A n -t x8 -N 32 /dev/urandom | tr -d ' \n'`
|
||
|
echo "const char *randstruct_seed = \"$SEED\";" > "$1"
|
||
|
HASH=`echo -n "$SEED" | sha256sum | cut -d" " -f1 | tr -d ' \n'`
|
||
|
echo "#define RANDSTRUCT_HASHED_SEED \"$HASH\"" > "$2"
|
||
|
fi
|