https://github.com/torvalds/linux
Raw File
Tip revision: eb7081409f94a9a8608593d0fb63a1aa3d6f95d8 authored by Linus Torvalds on 21 November 2022, 00:02:16 UTC
Linux 6.1-rc6
Tip revision: eb70814
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