https://github.com/torvalds/linux
Raw File
Tip revision: 7e18e42e4b280c85b76967a9106a13ca61c16179 authored by Linus Torvalds on 04 September 2022, 20:10:01 UTC
Linux 6.0-rc4
Tip revision: 7e18e42
gen-randstruct-seed.sh
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0

SEED=$(od -A n -t x8 -N 32 /dev/urandom | tr -d ' \n')
echo "$SEED" > "$1"
HASH=$(echo -n "$SEED" | sha256sum | cut -d" " -f1)
echo "#define RANDSTRUCT_HASHED_SEED \"$HASH\"" > "$2"
back to top