Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #563 from jstepien/random-bytes
Partial implementation of Random#bytes
- Loading branch information
Showing
with
6 additions
and 3 deletions.
- +1 −0 lib-topaz/bootstrap.rb
- +5 −0 lib-topaz/random.rb
- +0 −3 spec/tags/core/random/bytes_tags.txt
@@ -0,0 +1,5 @@ | ||
class Random | ||
def bytes(n) | ||
n.times.map { rand(256).chr } .join | ||
end | ||
end |
@@ -1,7 +1,4 @@ | ||
fails:Random#bytes returns a String | ||
fails:Random#bytes returns a String of the length given as argument | ||
fails:Random#bytes returns an ASCII-8BIT String | ||
fails:Random#bytes returns the same output for a given seed | ||
fails:Random#bytes returns the same numeric output for a given seed accross all implementations and platforms | ||
fails:Random#bytes returns the same numeric output for a given huge seed accross all implementations and platforms | ||
fails:Random#bytes returns a random binary String |