randgen 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/randgen.c +3 -3
- metadata +3 -3
data/randgen.c
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
#include "ruby.h"
|
11
11
|
|
12
12
|
// available characters
|
13
|
-
char *CHARS_IN = "
|
13
|
+
char *CHARS_IN = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
14
14
|
|
15
15
|
// generates an random string of length len
|
16
16
|
void generate_rand_str( char *cstr, int str_len ){
|
@@ -23,8 +23,8 @@ void generate_rand_str( char *cstr, int str_len ){
|
|
23
23
|
|
24
24
|
// loops len times
|
25
25
|
for(;i<str_len;i++){
|
26
|
-
// get a random number in the range of 0..
|
27
|
-
rand_idx = rand() %
|
26
|
+
// get a random number in the range of 0..61
|
27
|
+
rand_idx = rand() % 62;
|
28
28
|
// appends a random char from CHARS_IN
|
29
29
|
cstr[i] = (char)CHARS_IN[rand_idx];
|
30
30
|
}
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 5
|
9
|
+
version: 1.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Juha-Jarmo Heinonen
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-03 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|