Random file format

Hasard use plain text file format for the different test scripts. The file has two sections: [header] contains the metadata (maximum value, value format, value count, etc.) and [data] contains the values. Example of a file:

[header]
version=0.6
format=decimal
count=4
minimum=0
maximum=2147483646
rng=park_miller
operation=tick
seed_engine=linux_urandom
seed=550135504

[data]
16807
282475249
1622647863
947787490

Data

The data contains one value per line. The format depends on “format” header value:

  • decimal: Decimal integer, eg. “1977746726”
  • bytes: Long hexadecimal string, eg. “0xb27cff1e8a5393b790e613040b61b62e”. It’s better for text editors to use less then 80 characters per line (eg. 16 bytes per line).
  • float: Decimal floating point number, eg. “0.00659407751671”. There is no digit number minimal or maximal.

Compression

Since plain text uses is very verbose (files are huge), you can compress them using gzip or bzip2.

Comments

You can write comments anywhere using # character: the text after this character is removed. Empty line are also allowed anywhere. Example:

# This is a comment

[header]
maximum=255   # 2^8