1 | mruby-digest
|
---|
2 | =========
|
---|
3 |
|
---|
4 | ## Features
|
---|
5 |
|
---|
6 | Message Digest and HMAC classes are available. They are compatible with CRuby's ones.
|
---|
7 |
|
---|
8 | - Digest::MD5, Digest::RMD160, Digest::SHA1, Digest::SHA256, Digest::SHA384 and
|
---|
9 | Digest::SHA512
|
---|
10 | - Note: some of them are not available if libcrypto.a does not support them on your system.
|
---|
11 | - Digest::HMAC
|
---|
12 |
|
---|
13 | ## Install
|
---|
14 | - add conf.gem line to `build_config.rb`
|
---|
15 |
|
---|
16 | ```ruby
|
---|
17 | MRuby::Build.new do |conf|
|
---|
18 |
|
---|
19 | # ... (snip) ...
|
---|
20 |
|
---|
21 | conf.gem :git => 'https://github.com/iij/mruby-digest.git'
|
---|
22 | end
|
---|
23 | ```
|
---|
24 |
|
---|
25 | ## Usage
|
---|
26 | ```ruby
|
---|
27 | Digest::MD5.digest('ruby')
|
---|
28 | Digest::MD5.hexdigest('ruby')
|
---|
29 | ```
|
---|
30 |
|
---|
31 | ## Requirement
|
---|
32 | - OpenSSL library (libcrypto.a) on Unix systems
|
---|
33 | - Common Crypto library on MacOSX
|
---|
34 |
|
---|
35 | ## License
|
---|
36 |
|
---|
37 | Copyright (c) 2012 Internet Initiative Japan Inc.
|
---|
38 |
|
---|
39 | Permission is hereby granted, free of charge, to any person obtaining a
|
---|
40 | copy of this software and associated documentation files (the "Software"),
|
---|
41 | to deal in the Software without restriction, including without limitation
|
---|
42 | the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
---|
43 | and/or sell copies of the Software, and to permit persons to whom the
|
---|
44 | Software is furnished to do so, subject to the following conditions:
|
---|
45 |
|
---|
46 | The above copyright notice and this permission notice shall be included in
|
---|
47 | all copies or substantial portions of the Software.
|
---|
48 |
|
---|
49 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
50 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
51 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
52 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
---|
53 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
---|
54 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
---|
55 | DEALINGS IN THE SOFTWARE.
|
---|
56 |
|
---|