https://github.com/torvalds/linux
Raw File
Tip revision: 88603b6dc419445847923fcb7fe5080067a30f98 authored by Linus Torvalds on 01 January 2023, 21:53:16 UTC
Linux 6.2-rc2
Tip revision: 88603b6
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