Sha256: 102ce327cbbd6dcb9bdbe4c35addc7efa0095f335873860b06d85c4a070ebeac

Contents?: true

Size: 1.02 KB

Versions: 9

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 "git2_util.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

9 entries across 9 versions & 1 rubygems

Version Path
rugged-1.9.0 vendor/libgit2/src/util/rand.h
rugged-1.7.2 vendor/libgit2/src/util/rand.h
rugged-1.6.5 vendor/libgit2/src/util/rand.h
rugged-1.7.1 vendor/libgit2/src/util/rand.h
rugged-1.6.3 vendor/libgit2/src/util/rand.h
rugged-1.6.2 vendor/libgit2/src/util/rand.h
rugged-1.5.1 vendor/libgit2/src/util/rand.h
rugged-1.5.0.1 vendor/libgit2/src/util/rand.h
rugged-1.5.0 vendor/libgit2/src/util/rand.h