In http://www.aidanf.net/rails_user_authentication_tutorial there is a string called require ''digest/sha1'' in the model. What does it do? Everything else is well explained besides that. -- Posted via http://www.ruby-forum.com/.
P?l Bergstr?m wrote:> In http://www.aidanf.net/rails_user_authentication_tutorial there is a > string called require ''digest/sha1'' in the model. What does it do? > Everything else is well explained besides that.It is an encryption module. It is probably used to encrypt the password. -- Posted via http://www.ruby-forum.com/.
Mike Witt wrote:> P?l Bergstr?m wrote: >> In http://www.aidanf.net/rails_user_authentication_tutorial there is a >> string called require ''digest/sha1'' in the model. What does it do? >> Everything else is well explained besides that. > > It is an encryption module. It is probably used to encrypt the > password.I figured something like that. To bad it isn''t explained. Or maybe it is and I just don''t see it. -- Posted via http://www.ruby-forum.com/.
it''s a mixin Digest::sha1. if you''d like you could read about it on wikipedia.com, look under sha1 or encryption(i think it''s based on an encryption algorithim called MV4 or something like that, that NASA developed, although i am far from sure)...it''s quite interesting (although maybe not that important for developing an application, at least not more than the information that once something is encrypted, you can''t go the other way back[decrypt]) if you go to wiki.rubyonrails.com/pages/ and look under the login generator, there will be more information that you can find through the pre-written code. . . either way, enjoy : ) -- Posted via http://www.ruby-forum.com/.
''require'' is how you include other source files in ruby, in this case it''s the digest/sha1 code from the standard ruby library. P?l Bergstr?m wrote:> Mike Witt wrote: > >> P?l Bergstr?m wrote: >> >>> In http://www.aidanf.net/rails_user_authentication_tutorial there is a >>> string called require ''digest/sha1'' in the model. What does it do? >>> Everything else is well explained besides that. >>> >> It is an encryption module. It is probably used to encrypt the >> password. >> > > I figured something like that. To bad it isn''t explained. Or maybe it is > and I just don''t see it. > >
Inge J?rgensen wrote:> ''require'' is how you include other source files in ruby, in this case > it''s the digest/sha1 code from the standard ruby library.thanks. -- Posted via http://www.ruby-forum.com/.