mysql_make_scrambled_password 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/.rspec +0 -1
- data/README.md +5 -0
- data/ext/mysql_make_scrambled_password_core.c +22 -0
- data/lib/mysql_make_scrambled_password/version.rb +1 -1
- data/lib/mysql_make_scrambled_password.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 270a9648eabb7cde205f43fa5f4ed0699cbee638
|
4
|
+
data.tar.gz: 093a3f9391ab80b51148a0818965cc1ff1f72403
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5229de6da8b7a557a048a4c02ca77bfa094e8e595d9d2b96baacb1ceb7e15f5fca7bd6b53d3338f7b16c51dd855cd37573353915ac099cea7f08a38dbf37714a
|
7
|
+
data.tar.gz: e85b3f3c116ce97c644a9294a35912ee54f521d40788bba79df2339c569fe56a93484dcb8e2a7fda3962931b011a43fd19c3dd97445940480f9d770f564f337f
|
data/.rspec
CHANGED
data/README.md
CHANGED
@@ -26,6 +26,11 @@ Or install it yourself as:
|
|
26
26
|
require "mysql_make_scrambled_password"
|
27
27
|
include MysqlMakeScrambledPassword
|
28
28
|
|
29
|
+
# PASSWORD()
|
29
30
|
make_scrambled_password("FOOBARZOO")
|
30
31
|
#=> "*70B45D8E18771E93E011F30DB91E80D6306EA4C3"
|
32
|
+
|
33
|
+
# OLD_PASSWORD()
|
34
|
+
make_scrambled_password_323("FOOBARZOO")
|
35
|
+
#=> "6e35068701b1cc8b"
|
31
36
|
```
|
@@ -21,8 +21,30 @@ static VALUE rb_make_scrambled_password(VALUE self, VALUE v_password) {
|
|
21
21
|
return rb_str_new2(buf);
|
22
22
|
}
|
23
23
|
|
24
|
+
static VALUE rb_make_scrambled_password_323(VALUE self, VALUE v_password) {
|
25
|
+
char *password;
|
26
|
+
char *buf;
|
27
|
+
size_t len;
|
28
|
+
|
29
|
+
Check_Type(v_password, T_STRING);
|
30
|
+
|
31
|
+
len = RSTRING_LEN(v_password);
|
32
|
+
|
33
|
+
if (len < 1) {
|
34
|
+
return v_password;
|
35
|
+
}
|
36
|
+
|
37
|
+
password = RSTRING_PTR(v_password);
|
38
|
+
buf = alloca(CRYPT_MAX_PASSWORD_SIZE_PLUS_BUF + 1);
|
39
|
+
|
40
|
+
make_scrambled_password_323(buf, password);
|
41
|
+
|
42
|
+
return rb_str_new2(buf);
|
43
|
+
}
|
44
|
+
|
24
45
|
void Init_mysql_make_scrambled_password_core() {
|
25
46
|
VALUE rb_mMysqlMakeScrambledPassword = rb_define_module("MysqlMakeScrambledPassword");
|
26
47
|
VALUE rb_mMysqlMakeScrambledPasswordCore = rb_define_module_under(rb_mMysqlMakeScrambledPassword, "Core");
|
27
48
|
rb_define_module_function(rb_mMysqlMakeScrambledPasswordCore, "make_scrambled_password", rb_make_scrambled_password, 1);
|
49
|
+
rb_define_module_function(rb_mMysqlMakeScrambledPasswordCore, "make_scrambled_password_323", rb_make_scrambled_password_323, 1);
|
28
50
|
}
|
@@ -6,4 +6,9 @@ module MysqlMakeScrambledPassword
|
|
6
6
|
MysqlMakeScrambledPassword::Core.make_scrambled_password(password)
|
7
7
|
end
|
8
8
|
module_function :make_scrambled_password
|
9
|
+
|
10
|
+
def make_scrambled_password_323(password)
|
11
|
+
MysqlMakeScrambledPassword::Core.make_scrambled_password_323(password)
|
12
|
+
end
|
13
|
+
module_function :make_scrambled_password_323
|
9
14
|
end
|