type=class
superclass=Object
included=WEBrick=HTTPAuth=UserDB
extended=
library=webrick.httpauth.htpasswd

Apache  htpasswd ߴΥ饹.htpasswd ե򿷤뤳Ȥ롣
htpasswd -m (MD5)  -s (SHA) Ǻ줿 .htpasswd եˤбƤޤ




 require 'webrick'
 include WEBrick
 htpd = HTTPAuth::Htpasswd.new('dot.htpasswd')
 htpd.set_passwd(nil, 'username', 'supersecretpass')
 htpd.flush
 htpd2 = HTTPAuth::Htpasswd.new('dot.htpasswd')
 pass = htpd2.get_passwd(nil, 'username', false)
 p pass == 'supersecretpass'.crypt(pass[0,2])
