Skip to content

Commit

Permalink
Adds a second call to isaac(), references #1
Browse files Browse the repository at this point in the history
  • Loading branch information
guilload committed May 29, 2014
1 parent 88a98d2 commit a922127
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 34 deletions.
1 change: 1 addition & 0 deletions pyisaac/pyisaac.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,5 @@ static void seed(char *sd, int length)
memcpy((char *)rctx.randrsl + q * length, sd, r);

randinit(&rctx, TRUE);
isaac(&rctx);
}
34 changes: 1 addition & 33 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
RESULTS = [0xc9d3bc51, 0x5bc24339, 0x23e22e3a, 0x5659b89a, 0x21c6dcfd, 0x168e10a4, 0x1df755f6, 0x99d3a910,
0xf48f0656, 0xe9431f57, 0x839c384b, 0x238bac78, 0xd3693e2a, 0x96e06a6f, 0x1358bb9e, 0x6872ff7f,
0x75f9a391, 0x9d951a6f, 0x4460a8a1, 0x2818c604, 0x459b44fc, 0xe4eeacbf, 0xb13edb9c, 0x38f9a0c4,
0x9b6c882d, 0x44ddb798, 0x6a02781b, 0x464d8241, 0xb6e89c5b, 0xee627b94, 0x4b5cf183, 0x030800c9,
0x63e24cba, 0x9582bdaa, 0x8b038c2c, 0x5bcc29d7, 0xab4e8369, 0x7874b242, 0x1302a96d, 0xec44d5cc,
0x6cc59d03, 0x9abc6857, 0xea100737, 0xc567708f, 0xb25912b4, 0x53899438, 0xb33ba5c0, 0x08d848bc,
0xe32573ca, 0x1190acf5, 0xd015c2e7, 0xbe2f137f, 0x2f059bb6, 0x82ca6f0a, 0x39172da5, 0x9bcb3a5b,
0x8288cd54, 0x2f7a6e72, 0x371ac597, 0x3c9c00e1, 0x584ae462, 0x7420bf5e, 0xb3e7eeb3, 0xcb1f301d,
0x89f7548d, 0x5c758f6e, 0x5e5689f4, 0xfda0ec6b, 0xd080797e, 0xc8ce8e0e, 0x08ed5b1a, 0x75f4dca7,
0xc03c8d08, 0xad11d474, 0xcb4ee33a, 0x6588dd1e, 0xe71dd73d, 0x25b36d83, 0xc2a014ee, 0x1f1be022,
0x97748d52, 0xba47b4b2, 0xb5b0f69f, 0x9092902e, 0x8cc370f9, 0xa65b687f, 0xbb8ad147, 0x3c532186,
0x25ff761b, 0xf507c27c, 0xafb18108, 0x3b8e7ade, 0x3044df96, 0xf5b51be4, 0xb8b3895f, 0x56ad9f82,
0x13cf0045, 0xadbbcd41, 0xba984c48, 0xac14915f, 0x4dea8a1c, 0x70240f6e, 0x46e5085b, 0x44995e68,
0xd49a2785, 0xbec21184, 0x33bd3209, 0x28b6c25f, 0x8aaa592c, 0x642844eb, 0xb2a8bf4f, 0xb62c21b4,
0x1ed94071, 0x5047c204, 0x9966bf98, 0x54d6a1de, 0xd3b08718, 0x602cdd1e, 0x27d3b289, 0xf5284ba7,
0xe552480e, 0xb4317128, 0xa6a831c7, 0xef98ba77, 0x082e2387, 0xa60f8187, 0x1bdda376, 0xd11b59d2,
0x0b2adb58, 0x5f07968d, 0x63565555, 0x6eaaa2da, 0x43de6b6d, 0x86d498ff, 0xe3492290, 0x87aa3a05,
0x4ea8d3b5, 0xbb9fe9a1, 0x798b2222, 0x3e77c27e, 0xd263434e, 0x82d504cb, 0x5936c07b, 0x82b93bcb,
0x40e1ddc4, 0xfed24c09, 0x5e66d6e5, 0xb3f09f1d, 0x812b901c, 0x99b87e3b, 0x7ac6b7ed, 0x30d63060,
0x7508dc03, 0xa42248a9, 0xad313fdf, 0x3a4e945c, 0xac875460, 0x0940e817, 0x9f71db1f, 0xed35bebe,
0x29c77c31, 0x79e42f94, 0xa3dbcd79, 0x40651421, 0xd9af6853, 0x66b9ecc1, 0x9d93f3c4, 0xa38e3003,
0x181e1ab7, 0xc952f8ef, 0xdfaebb9e, 0x91a50215, 0x95590c72, 0xd2d2db40, 0x7a479242, 0x9ae6f3dc,
0x6d6ee596, 0xf0ccabd5, 0x50367e9e, 0xaf96bafa, 0xc4940ecd, 0x63a82778, 0xe40950a9, 0xfabf9e2c,
0xf91450e9, 0x1ad83713, 0x795209f6, 0x9f7d8ca0, 0xc4cd930c, 0x2ac7c086, 0xa24e2dab, 0x8b7a3616,
0xb691e3ec, 0xf30e7631, 0x3f09c258, 0x4ea46c5a, 0xd799e7d8, 0x75d3fa5d, 0x17966f6c, 0xb9f30b32,
0xda1e3c67, 0xab3dc36a, 0xd3a47ef3, 0x48301362, 0x0df21a5c, 0x38731862, 0xa8b52636, 0xf4b7ab4f,
0xb709addd, 0x0642b616, 0x645c68bb, 0x7defde20, 0xc7eb832e, 0xc5d9d39e, 0xc52256e5, 0x992300b4,
0xc581df99, 0xa642f4aa, 0xd4f0ba87, 0x94b9d830, 0x92c4ced6, 0xa74b776e, 0x87d32645, 0xdab3bd5f,
0x99f8eec0, 0xe0457735, 0xb44c5c92, 0x95688a53, 0x3856aae8, 0x3352431d, 0x77449906, 0x011d7f76,
0x936df33e, 0x5de7c346, 0x2f6039f8, 0x05795322, 0xd6b64887, 0x9f812dab, 0x416c484d, 0xc63687a5,
0xb0658c71, 0x772bfea5, 0x3ed63727, 0xcc03377f, 0x2d658374, 0x40597e84, 0xef62dfaa, 0x3ba989b7,
0xd1b26dc5, 0xd3a7f5e1, 0xe5de149f, 0x9c26e15a, 0x63477791, 0x3c7a0855, 0xf00990dd, 0xcb673179,
0x58759924, 0x2be2c273, 0x03165f2e, 0xe4f4832b, 0x88fa93d2, 0xcc096c83, 0xfb713a21, 0x99aa55bd,
RESULTS = [0x58759924, 0x2be2c273, 0x03165f2e, 0xe4f4832b, 0x88fa93d2, 0xcc096c83, 0xfb713a21, 0x99aa55bd,
0xeae7f35d, 0xddaf236c, 0xda0552ce, 0xd2fb442f, 0xfd1ac65e, 0xa680c86c, 0x7a9f36c0, 0xa5ccce35,
0x8060b929, 0xe2a6a2da, 0x68175335, 0x18859b40, 0xd2b4213b, 0x97a896c0, 0x119d3659, 0xbc89d7b1,
0x8feb1ca4, 0x68329ee6, 0x5881583d, 0xcd58805e, 0x2621ab01, 0xf0b07a6b, 0x88307d30, 0x75b6547d,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pyisaac.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ def test_pyisaac(self):
seed = mytext + '\x00' * (1024 - len(mytext))
pyisaac.seed(seed)

self.assertListEqual([pyisaac.random() for _ in range(256 * 10)], RESULTS)
self.assertEqual([pyisaac.random() for _ in range(256 * 9)], RESULTS)

0 comments on commit a922127

Please sign in to comment.