aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/python/rng_test.py
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-04-08 14:57:49 +0000
committerlloyd <[email protected]>2011-04-08 14:57:49 +0000
commitfc62f7f284387a180e42402e8706965a666efba7 (patch)
tree9abe74c670993c111bd3a5bf5fb568767f9e75be /doc/examples/python/rng_test.py
parent438f3eb73e494fcab82b239452d712bec06f48c9 (diff)
More pubkey doc updates
Diffstat (limited to 'doc/examples/python/rng_test.py')
-rwxr-xr-xdoc/examples/python/rng_test.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/examples/python/rng_test.py b/doc/examples/python/rng_test.py
new file mode 100755
index 000000000..06c79b84e
--- /dev/null
+++ b/doc/examples/python/rng_test.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+
+import botan
+
+rng = botan.RandomNumberGenerator()
+
+print "name", rng.name()
+
+rng.add_entropy("blah")
+
+print "random 16", rng.gen_random(16).encode("hex")
+print "random 32", rng.gen_random(32).encode("base64"),
+
+rng.reseed()
+
+for i in range(0, 10):
+ print rng.gen_random_byte(),
+print
+
+rng.add_entropy("blah")
+
+print "random 16", rng.gen_random(16).encode("hex")