CCrypt¶ ↑
DESCRIPTION:¶ ↑
Ruby wrapper for the C crypt() function.
NOTE This just duplicates what String#crypt does. The gem was written before that was discovered. Use String#crypt instead of this gem.
FEATURES/PROBLEMS:¶ ↑
-
Only builds against Ubuntu
-
Probably not thread safe
-
Duplicates String#crypt
OS X¶ ↑
Whilst the gem compiles and works on OS X, it’s using the BSD crypt() function, not the GNU stdlib’s function. This means you get a completely different hash back from it.
The reason “support” for OS X has been added is so our developers who use Macs can still run the applications that lean on c_crypt locally.
SYNOPSIS:¶ ↑
Use it exactly the same as +crypt()+, give it a string to hash, and a salt. The start of the salt determines what algorithm is used. See +man 3 crypt+ for more help.
CCrypt.crypt3 "opensourceftw", "$6$3M7.v1fn" # >> "$6$3M7.v1fn$wnZOFg5k99FJ2p4DDVrDy9uJgv4ow.gi4B0Qz.ppWCvBI6FFtEVwtbwCIBbxo59mu5qhE0sS2Bc6zY09GZPC20"
REQUIREMENTS:¶ ↑
-
Ubuntu
-
Ruby 1.8
INSTALL:¶ ↑
-
sudo gem install c_crypt
LICENSE:¶ ↑
(The MIT License)
Copyright © 2010 Brightbox Systems Ltd. <hello@brightbox.co.uk>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.