Sha256: 3e1a0e53933ebdfed9517b294d8bd7dcc1a9f1235113803a3ecf9b36c91ba219

Contents?: true

Size: 1.02 KB

Versions: 4

Compression:

Stored size: 1.02 KB

Contents

/*
 * Copyright (C) the libgit2 contributors. All rights reserved.
 *
 * This file is part of libgit2, distributed under the GNU GPL v2 with
 * a Linking Exception. For full terms see the included COPYING file.
 */
#ifndef INCLUDE_rand_h__
#define INCLUDE_rand_h__

#include "common.h"

/**
 * Initialize the random number generation subsystem.  This will
 * seed the random number generator with the system's entropy pool,
 * if available, and will fall back to the current time and
 * system information if not.
 */
int git_rand_global_init(void);

/**
 * Seed the pseudo-random number generator.  This is not needed to be
 * called; the PRNG is seeded by `git_rand_global_init`, but it may
 * be useful for testing.  When the same seed is specified, the same
 * sequence of random numbers from `git_rand_next` is emitted.
 *
 * @param seed the seed to use
 */
void git_rand_seed(uint64_t seed);

/**
 * Get the next pseudo-random number in the sequence.
 *
 * @return a 64-bit pseudo-random number
 */
uint64_t git_rand_next(void);

#endif

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rugged-1.4.5 vendor/libgit2/src/rand.h
rugged-1.4.4 vendor/libgit2/src/rand.h
rugged-1.4.3 vendor/libgit2/src/rand.h
rugged-1.4.2 vendor/libgit2/src/rand.h