Hi I want to genrate 10 random 32 bit binary numbers with hamming distance 4 and 8.
11010110010101010101010101010101
11010110010101010100010101010010
if we look carefully at these two binary numbers they differ at 4 places hence hamming distance 4. Now I want to genrate these numbers... (2 Replies)
Hi,
I am having trouble with generating random numbers. can this be done with awk?
So I have a file that looks like this:
23 30
24 40
26 34
So column1 is start and column2 is end. I want to generate 3 random #'s between start and stop:
So the output will look like this:
... (9 Replies)
Im new to C, and Im having a hard time getting a random number.
In bash, I would do something similar to the following to get a random number;
#!/bin/bash
seed1=$RANDOM
seed2=$RANDOM
seed3=$RANDOM
SEED=`expr $seed1 * $seed2 / $seed3`
echo ${SEED%.*}
Now, in online examples... (4 Replies)
Hello All, I am stuck up in a program where the rand functions ends up giving all the same integers. Tried sleep, but the numbers turned out to be same... Can anyone help me out how to fix this issue ? I have called the srand once in the program, but I feel like when I call fork the child process... (5 Replies)
Hi Unix Gurus,
I have a requirement to generate positive random 16 and 13 digit numbers.
Here is the script I have so far.....
number=$RANDOM$RANDOM$RANDOM$RANDOM;
let "number %= 10000000000000";
echo $number
But sometimes it is generating negative numbers and also 15 digit... (8 Replies)
Hi there I am trying to generate a random number between 40 and 70 using the shell here is my code so far and it keeps going above 70. all help much appreciated!
comp=$(( RANDOM%70+40 ))
echo $comp (4 Replies)
Having a hard time with this. Very new to scripting and linux. Spent all sunday trying to do this. Appreciate some help and maybe help breaking down what the syntax does.
Create a Bash program. It should have the following properties
• Creates a secret number between 1 and 100
i. The... (3 Replies)
Hi,
How can I generate a string of random characters (alpha+numeric) of a particular length ?
For e.g. for
n=5, output = 'kasjf'
n=10, output = 'hedbcd902k'
Also, please let me know if random (valid) dates could also be generated.
Thanks (7 Replies)
Hi Guys and gals...
As you know I am getting to grips with POSIX and hit this stumbling block.
Generating two random numbers 0 to 255 POSIXly. Speed in not important hence the 'sleep 1' command.
I have done a demo that works, but it sure is ugly! Is there a better way?
#!/bin/sh
# Random... (12 Replies)
Discussion started by: wisecracker
12 Replies
LEARN ABOUT DEBIAN
tspi_tpm_getrandom
Tspi_TPM_GetRandom(3) Library Functions Manual Tspi_TPM_GetRandom(3)
TCG Software Stack Developer's Reference
NAME
Tspi_TPM_GetRandom - generate a random number on the TPM
SYNOPSIS
#include <tss/platform.h>
#include <tss/tcpa_defines.h>
#include <tss/tcpa_typedef.h>
#include <tss/tcpa_struct.h>
#include <tss/tss_typedef.h>
#include <tss/tss_structs.h>
#include <tss/tspi.h>
TSS_RESULT Tspi_TPM_GetRandom(TSS_HTPM hTPM, UINT32 size, BYTE** random);
DESCRIPTION
Tspi_TPM_GetRandom gets a good random number for the purpose of generating symmetric keys, nonces, or seeding a random number generator.
PARAMETERS
hTPM
The hTPM parameter is used to specify the handle of the TPM object. The command to get the TPM to test itself will be sent here.
size
The size parameter is the number of random bytes requested.
random
The random parameter is a pointer to memory containing the random data. This is where the generated number goes. Because this internally
allocates memory, Tspi_Context_FreeMemory should also be used.
RETURN CODES
Tspi_TPM_GetRandom returns TSS_SUCCESS on success, otherwise one of the following values is returned:
TSS_E_INVALID_HANDLE
hTPM is not a valid handle.
TSS_E_INTERNAL_ERROR
An internal SW error has been detected.
TSS_E_BAD_PARAMETER
One or more parameters is bad.
CONFORMING TO
Tspi_TPM_GetRandom conforms to the Trusted Computing Group Software Specification version 1.1 Golden
SEE ALSO Tspi_Context_FreeMemory(3).
TSS 1.1 2004-05-25 Tspi_TPM_GetRandom(3)