pcg_random 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c4224a9b36896755ece6fca2b0845557df14c600
4
+ data.tar.gz: 0eee51e96175a204bcea1bb18009bc5b5132d347
5
+ SHA512:
6
+ metadata.gz: bb55e8170e1e2cd965ea38f1c00e11656e440f6813d8ed3137e4c9857e5a62a0e095b07103d7934e8b35566077c6138f810c908512182ac624bd7e723bc8a64a
7
+ data.tar.gz: 312dfe2f1cd5f6241c965f31fadc994f33cc44e5cc707d45e3cd5716131f681c8e7486013fd142193b2d5fea457dee5470da222a9650a201aa4e1557341cb5bb
data/.gitignore ADDED
@@ -0,0 +1,27 @@
1
+ # Defaults
2
+ /.bundle/
3
+ /.yardoc
4
+ /Gemfile.lock
5
+ /_yardoc/
6
+ /coverage/
7
+ /doc/
8
+ /pkg/
9
+ /spec/reports/
10
+ /tmp/
11
+
12
+ # Compiled binaries
13
+ *.bundle
14
+ *.so
15
+ *.o
16
+ *.a
17
+ *.gem
18
+
19
+ # logs
20
+ *.log
21
+
22
+ # Github commit messages
23
+ .gitmsg
24
+
25
+ # Benchmark code till I find an alternative way that doesn't piss off
26
+ # rake-compiler
27
+ /bench/
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.3.0
4
+ before_install: gem install bundler -v 1.11.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in pcg_random.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Vaibhav Yenamandra
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # PcgRandom
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/pcg_random`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'pcg_random'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install pcg_random
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/pcg_random.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
data/Rakefile ADDED
@@ -0,0 +1,20 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ require "rake/extensiontask"
7
+
8
+ task :build => :compile
9
+
10
+ Rake::ExtensionTask.new("pcg_random") do |ext|
11
+ ext.lib_dir = "lib/pcg_random"
12
+ end
13
+
14
+ task :cc => [:clean, :compile]
15
+
16
+ task :default => [:clobber, :compile, :spec]
17
+
18
+ task :bench do
19
+ PCGBench.press
20
+ end
data/bin/console ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "pcg_random"
5
+
6
+ require "pry"
7
+ Pry.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,123 @@
1
+ /*
2
+ * PCG Random Number Generation for C.
3
+ *
4
+ * Copyright 2014 Melissa O'Neill <oneill@pcg-random.org>
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ * For additional information about the PCG random number generation scheme,
19
+ * including its license and other licensing options, visit
20
+ *
21
+ * http://www.pcg-random.org
22
+ */
23
+
24
+ /* This code provides a mechanism for getting external randomness for
25
+ * seeding purposes. Usually, it's just a wrapper around reading
26
+ * /dev/random.
27
+ *
28
+ * Alas, because not every system provides /dev/random, we need a fallback.
29
+ * We also need to try to test whether or not to use the fallback.
30
+ */
31
+
32
+ #include <stddef.h>
33
+ #include <stdlib.h>
34
+ #include <stdint.h>
35
+ #include <stdbool.h>
36
+ #include <time.h>
37
+
38
+ #include "pcg_variants.h"
39
+ #include "pcg_spinlock.h"
40
+
41
+ #include "entropy.h"
42
+
43
+ #ifndef IS_UNIX
44
+ #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) \
45
+ || (defined(__APPLE__) && defined(__MACH__)))
46
+ #define IS_UNIX 1
47
+ #else
48
+ #define IS_UNIX 0
49
+ #endif
50
+ #endif
51
+
52
+ // If HAVE_DEV_RANDOM is set, we use that value, otherwise we guess
53
+ #ifndef HAVE_DEV_RANDOM
54
+ #define HAVE_DEV_RANDOM IS_UNIX
55
+ #endif
56
+
57
+ #if HAVE_DEV_RANDOM
58
+ #include <fcntl.h>
59
+ #include <unistd.h>
60
+ #endif
61
+
62
+ #if HAVE_DEV_RANDOM
63
+ /* entropy_getbytes(dest, size):
64
+ * Use /dev/random to get some external entropy for seeding purposes.
65
+ *
66
+ * Note:
67
+ * If reading /dev/random fails (which ought to never happen), it returns
68
+ * false, otherwise it returns true. If it fails, you could instead call
69
+ * fallback_entropy_getbytes which always succeeds.
70
+ */
71
+
72
+ bool entropy_getbytes(void* dest, size_t size)
73
+ {
74
+ int fd = open("/dev/random", O_RDONLY);
75
+ if (fd < 0)
76
+ return false;
77
+ int sz = read(fd, dest, size);
78
+ if (sz < size)
79
+ return false;
80
+ return close(fd) == 0;
81
+ }
82
+ #else
83
+ bool entropy_getbytes(void* dest, size_t size)
84
+ {
85
+ fallback_entropy_getbytes(dest, size);
86
+ return true;
87
+ }
88
+ #endif
89
+
90
+ /* fallback_entropy_getbytes(dest, size):
91
+ * Works like the /dev/random version above, but avoids using /dev/random.
92
+ * Instead, it uses a private RNG (so that repeated calls will return
93
+ * different seeds). Makes no attempt at cryptographic security.
94
+ */
95
+
96
+ void fallback_entropy_getbytes(void* dest, size_t size)
97
+ {
98
+ // Most modern OSs use address-space randomization, meaning that we can
99
+ // use the address of stack variables and system library code as
100
+ // initializers. It's not as good as using /dev/random, but probably
101
+ // better than using the current time alone.
102
+
103
+ static PCG_SPINLOCK_DECLARE(mutex);
104
+ PCG_SPINLOCK_LOCK(mutex);
105
+
106
+ static int intitialized = 0;
107
+ static pcg32_random_t entropy_rng;
108
+
109
+ if (!intitialized) {
110
+ int dummyvar;
111
+ pcg32_srandom_r(&entropy_rng,
112
+ time(NULL) ^ (intptr_t)&fallback_entropy_getbytes,
113
+ (intptr_t)&dummyvar);
114
+ intitialized = 1;
115
+ }
116
+
117
+ char* dest_cp = (char*) dest;
118
+ for (size_t i = 0; i < size; ++i) {
119
+ dest_cp[i] = (char) pcg32_random_r(&entropy_rng);
120
+ }
121
+
122
+ PCG_SPINLOCK_UNLOCK(mutex);
123
+ }
@@ -0,0 +1,40 @@
1
+ /*
2
+ * PCG Random Number Generation for C.
3
+ *
4
+ * Copyright 2014 Melissa O'Neill <oneill@pcg-random.org>
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ * For additional information about the PCG random number generation scheme,
19
+ * including its license and other licensing options, visit
20
+ *
21
+ * http://www.pcg-random.org
22
+ */
23
+
24
+ #ifndef ENTROPY_H_INCLUDED
25
+ #define ENTROPY_H_INCLUDED 1
26
+
27
+ #include <stdbool.h>
28
+
29
+ #if __cplusplus
30
+ extern "C" {
31
+ #endif
32
+
33
+ extern bool entropy_getbytes(void* dest, size_t size);
34
+ extern void fallback_entropy_getbytes(void* dest, size_t size);
35
+
36
+ #if __cplusplus
37
+ }
38
+ #endif
39
+
40
+ #endif // ENTROPY_H_INCLUDED
@@ -0,0 +1,28 @@
1
+ require "mkmf"
2
+
3
+ RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
4
+
5
+ $CFLAGS = "-Wall -pedantic -ansi -std=c99"
6
+
7
+ LIBDIR = RbConfig::CONFIG['libdir']
8
+ INCLUDEDIR = RbConfig::CONFIG['includedir']
9
+
10
+ HEADER_DIRS = [
11
+ '/opt/local/include',
12
+ '/usr/local/include',
13
+ INCLUDEDIR,
14
+ '/usr/include',
15
+ ]
16
+
17
+ LIB_DIRS = [
18
+ '/opt/local/lib',
19
+ '/usr/local/lib',
20
+ LIBDIR,
21
+ '/usr/lib',
22
+ ]
23
+
24
+ abort 'libpcgrandom is missing' unless find_header('pcg_variants.h')
25
+ abort 'entropy.h missing' unless find_header('entropy.h')
26
+
27
+ dir_config('pcg_random', HEADER_DIRS, LIB_DIRS)
28
+ create_makefile("pcg_random/pcg_random")
@@ -0,0 +1,24 @@
1
+ #include <ruby.h>
2
+ #include <pcg_variants.h>
3
+ #include <inttypes.h>
4
+ #include <string.h>
5
+
6
+ #include "rb_constants.h"
7
+ #include "pcg_random.h"
8
+ #include "pcg_seed.h"
9
+
10
+ VALUE rb_mPCGRandom;
11
+
12
+ void
13
+ Init_pcg_random(void)
14
+ {
15
+ /* Initialize constants used by C-code*/
16
+ pcg_init_rb_constants();
17
+
18
+ /* Define encapsulating module */
19
+ rb_mPCGRandom = rb_define_class("PCGRandom", rb_cObject);
20
+
21
+ /* Define methods under PCGRandom */
22
+ rb_define_singleton_method(rb_cPCGRandom, "new_seed", pcg_func_new_seed, 0);
23
+ rb_define_singleton_method(rb_cPCGRandom, "raw_seed", pcg_func_raw_seed, 1);
24
+ }
@@ -0,0 +1,9 @@
1
+ #ifndef PCG_RANDOM_H
2
+ #define PCG_RANDOM_H 1
3
+
4
+ #include <ruby.h>
5
+ #include <inttypes.h>
6
+
7
+ extern VALUE rb_cPCGRandom;
8
+
9
+ #endif /* PCG_RANDOM_H */
@@ -0,0 +1,94 @@
1
+ #include <ruby.h>
2
+ #include <pcg_variants.h>
3
+ #include <stdbool.h>
4
+
5
+ #include "entropy.h"
6
+ #include "rb_constants.h"
7
+ #include "pcg_seed.h"
8
+
9
+ /* Functions local to this source file */
10
+ static VALUE pcg_new_seed_bytestr(void);
11
+ static VALUE pcg_raw_seed_bytestr(size_t size);
12
+ static VALUE pcg_rb_unpack_str_ui64(VALUE str);
13
+
14
+ /*
15
+ * Returns a 128-bit big-integer that stores the seed value used to seed the
16
+ * initial state and sequence for the PCG generator.
17
+ */
18
+ VALUE
19
+ pcg_func_new_seed(void)
20
+ {
21
+ return pcg_new_seed_bytestr();
22
+ }
23
+
24
+ /*
25
+ * Generates a random seed represented as a sequence of bytes
26
+ */
27
+ VALUE
28
+ pcg_func_raw_seed(VALUE self, VALUE byte_size)
29
+ {
30
+ unsigned long n = NUM2ULONG(byte_size);
31
+ if( n == 0 )
32
+ {
33
+ return rb_str_new2("\0");
34
+ }
35
+ return pcg_raw_seed_bytestr(n);
36
+ }
37
+
38
+ /*
39
+ * Generates a sequence of random bytes using device entropy
40
+ * or a fallback mechanism based on pcg32_random_r
41
+ */
42
+ bool
43
+ pcg_func_entropy_getbytes(void *dest, size_t size)
44
+ {
45
+ /* Get random bytes from /dev/random or a fallback source */
46
+ if( !entropy_getbytes(dest, size) )
47
+ {
48
+ fallback_entropy_getbytes(dest, size);
49
+ return true;
50
+ }
51
+ return false;
52
+ }
53
+
54
+ /*
55
+ * Internal - Unpacks a string `str` wuth str.unpack('Q*')
56
+ * Unpacks and returns the 0th entry (since it's always a 1 element array)
57
+ */
58
+ static VALUE
59
+ pcg_rb_unpack_str_ui64(VALUE str)
60
+ {
61
+ VALUE ary = rb_funcall(str, rb_intern("unpack"), 1, rb_str_new2("Q*\0"));
62
+ return rb_ary_entry(ary, 0);
63
+ }
64
+
65
+ /*
66
+ * Internal - gets `size` number of random bytes from a platform source
67
+ * and returns those as a ruby string
68
+ */
69
+ static VALUE
70
+ pcg_raw_seed_bytestr(size_t size)
71
+ {
72
+ char *bytestr = (char *) malloc(size + 1);
73
+ memset(bytestr, 0, size + 1);
74
+ pcg_func_entropy_getbytes((void *)bytestr, size);
75
+
76
+ return rb_str_new2(bytestr);
77
+ }
78
+
79
+ /*
80
+ * Internal - Two random integers are sourced from /dev/random or a fallback
81
+ * technique.
82
+ * Seed generated by manipulating a 16byte string & unpacking it to Q*
83
+ *
84
+ * @see pcg_new_seed_bigmul() for alternative techniques
85
+ */
86
+ static VALUE
87
+ pcg_new_seed_bytestr(void)
88
+ {
89
+ VALUE seed_bytes_str;
90
+
91
+ seed_bytes_str = pcg_raw_seed_bytestr(2 * sizeof(uint64_t));
92
+ return pcg_rb_unpack_str_ui64(seed_bytes_str);
93
+ }
94
+
@@ -0,0 +1,11 @@
1
+ #ifndef PCG_SEED_H
2
+ #define PCG_SEED_H 1
3
+
4
+ #include <ruby.h>
5
+ #include <stdbool.h>
6
+
7
+ VALUE pcg_func_new_seed(void);
8
+ bool pcg_func_entropy_getbytes(void* dest, size_t size);
9
+ VALUE pcg_func_raw_seed(VALUE self, VALUE byte_size);
10
+
11
+ #endif /* PCG_SEED_H */
@@ -0,0 +1,57 @@
1
+ /*
2
+ * PCG Random Number Generation for C.
3
+ *
4
+ * Copyright 2014 Melissa O'Neill <oneill@pcg-random.org>
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ * For additional information about the PCG random number generation scheme,
19
+ * including its license and other licensing options, visit
20
+ *
21
+ * http://www.pcg-random.org
22
+ */
23
+
24
+ /* This code provides a minimal spinlock implementation. It's only used
25
+ * in supporting fallback_entropy_getbytes.
26
+ */
27
+
28
+ #ifndef PCG_SPINLOCK_H_INCLUDED
29
+ #define PCG_SPINLOCK_H_INCLUDED 1
30
+
31
+ #ifndef __has_include
32
+ #define INCLUDE_OKAY(x) 1
33
+ #else
34
+ #define INCLUDE_OKAY(x) __has_include(x)
35
+ #endif
36
+
37
+ #if __STDC_VERSION__ >= 201112L && !__STDC_NO_ATOMICS__ \
38
+ && INCLUDE_OKAY(<stdatomic.h>)
39
+ #include <stdatomic.h>
40
+ #define PCG_SPINLOCK_DECLARE(mutex) atomic_flag mutex = ATOMIC_FLAG_INIT
41
+ #define PCG_SPINLOCK_LOCK(mutex) do {} \
42
+ while (atomic_flag_test_and_set(&mutex))
43
+ #define PCG_SPINLOCK_UNLOCK(mutex) atomic_flag_clear(&mutex)
44
+ #elif __GNUC__
45
+ #define PCG_SPINLOCK_DECLARE(mutex) volatile int mutex = 0
46
+ #define PCG_SPINLOCK_LOCK(mutex) \
47
+ do {} while(__sync_lock_test_and_set(&mutex, 1))
48
+ #define PCG_SPINLOCK_UNLOCK(mutex) __sync_lock_release(&mutex)
49
+ #else
50
+ #warning No implementation of spinlocks provided. No thread safety.
51
+ #define PCG_SPINLOCK_DECLARE(mutex) volatile int mutex = 0
52
+ #define PCG_SPINLOCK_LOCK(mutex) \
53
+ do { while(mutex == 1){} mutex = 1; } while(0)
54
+ #define PCG_SPINLOCK_UNLOCK(mutex) mutex = 0;
55
+ #endif
56
+
57
+ #endif // PCG_SPINLOCK_H_INCLUDED
@@ -0,0 +1,13 @@
1
+ #include <ruby.h>
2
+ #include "rb_constants.h"
3
+
4
+ VALUE pcg_rb_zero,
5
+ pcg_rb_one;
6
+
7
+ void
8
+ pcg_init_rb_constants(void)
9
+ {
10
+ /* Commonly used ruby objects */
11
+ pcg_rb_zero = INT2FIX(0u);
12
+ pcg_rb_one = INT2FIX(1u);
13
+ }
@@ -0,0 +1,11 @@
1
+ #ifndef PCG_RB_CONSTANTS_H
2
+ #define PCG_RB_CONSTANTS_H 1
3
+
4
+ #include <ruby.h>
5
+
6
+ extern VALUE pcg_rb_zero,
7
+ pcg_rb_one;
8
+
9
+ void pcg_init_rb_constants(void);
10
+
11
+ #endif /* PCG_RB_CONSTANTS_H */
@@ -0,0 +1,3 @@
1
+ class PCGRandom
2
+ VERSION = "0.1.1"
3
+ end
data/lib/pcg_random.rb ADDED
@@ -0,0 +1,2 @@
1
+ require "pcg_random/version"
2
+ require "pcg_random/pcg_random"
@@ -0,0 +1,36 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'pcg_random/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'pcg_random'
8
+ spec.version = PCGRandom::VERSION
9
+ spec.authors = ['Vaibhav Yenamandra']
10
+ spec.email = ['yvvaibhav@gmail.com']
11
+
12
+ spec.summary = %q{Ruby interface to the pcg random number generator}
13
+ spec.description = %q{PCG is a family of simple fast space-efficient statistically good algorithms for random number generation. Unlike many general-purpose RNGs, they are also hard to predict. This library aims to act as the ruby interface to this set of functions}
14
+ spec.homepage = 'https://github.com/vaibhav-y/pcg_random'
15
+ spec.license = 'MIT'
16
+
17
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
+ # delete this section to allow pushing this gem to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
21
+ else
22
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
+ end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ['lib']
29
+ spec.extensions = ['ext/pcg_random/extconf.rb']
30
+
31
+ spec.add_development_dependency 'bundler', '~> 1.11'
32
+ spec.add_development_dependency 'rake', '~> 10.0'
33
+ spec.add_development_dependency 'rake-compiler', '~> 0'
34
+ spec.add_development_dependency 'rspec', '~> 3.0'
35
+ spec.add_development_dependency 'pry', '~> 0'
36
+ end
metadata ADDED
@@ -0,0 +1,139 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pcg_random
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Vaibhav Yenamandra
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-03-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.11'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake-compiler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: PCG is a family of simple fast space-efficient statistically good algorithms
84
+ for random number generation. Unlike many general-purpose RNGs, they are also hard
85
+ to predict. This library aims to act as the ruby interface to this set of functions
86
+ email:
87
+ - yvvaibhav@gmail.com
88
+ executables: []
89
+ extensions:
90
+ - ext/pcg_random/extconf.rb
91
+ extra_rdoc_files: []
92
+ files:
93
+ - ".gitignore"
94
+ - ".travis.yml"
95
+ - Gemfile
96
+ - LICENSE.txt
97
+ - README.md
98
+ - Rakefile
99
+ - bin/console
100
+ - bin/setup
101
+ - ext/pcg_random/entropy.c
102
+ - ext/pcg_random/entropy.h
103
+ - ext/pcg_random/extconf.rb
104
+ - ext/pcg_random/pcg_random.c
105
+ - ext/pcg_random/pcg_random.h
106
+ - ext/pcg_random/pcg_seed.c
107
+ - ext/pcg_random/pcg_seed.h
108
+ - ext/pcg_random/pcg_spinlock.h
109
+ - ext/pcg_random/rb_constants.c
110
+ - ext/pcg_random/rb_constants.h
111
+ - lib/pcg_random.rb
112
+ - lib/pcg_random/version.rb
113
+ - pcg_random.gemspec
114
+ homepage: https://github.com/vaibhav-y/pcg_random
115
+ licenses:
116
+ - MIT
117
+ metadata:
118
+ allowed_push_host: https://rubygems.org
119
+ post_install_message:
120
+ rdoc_options: []
121
+ require_paths:
122
+ - lib
123
+ required_ruby_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ requirements: []
134
+ rubyforge_project:
135
+ rubygems_version: 2.5.1
136
+ signing_key:
137
+ specification_version: 4
138
+ summary: Ruby interface to the pcg random number generator
139
+ test_files: []