D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
OpenSSL
/
HMAC
/
Filename :
new-c.ri
back
Copy
U:RDoc::AnyMethod[iI"new:ETI"OpenSSL::HMAC::new;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [ I"FReturns an instance of OpenSSL::HMAC set with the key and digest ;TI"Halgorithm to be used. The instance represents the initial state of ;TI"Ithe message authentication code before any data has been processed. ;TI"HTo process data with it, use the instance method #update with your ;TI"data as an argument.;To:RDoc::Markup::BlankLine S:RDoc::Markup::Heading: leveli: textI"Example;T@o:RDoc::Markup::Verbatim; [ I"key = 'key' ;TI"/instance = OpenSSL::HMAC.new(key, 'SHA1') ;TI"2#=> f42bb0eeb018ebbd4597ae7213711ec60760843f ;TI"instance.class ;TI"#=> OpenSSL::HMAC ;T:@format0S;; i;I"A note about comparisons;T@o; ; [I"FTwo instances can be securely compared with #== in constant time:;T@o;; [ I"; other_instance = OpenSSL::HMAC.new('key', 'SHA1') ;TI"2#=> f42bb0eeb018ebbd4597ae7213711ec60760843f ;TI" instance == other_instance ;TI" #=> true;T;0: @fileI"ext/openssl/ossl_hmac.c;T:0@omit_headings_from_table_of_contents_below0I"#HMAC.new(key, digest) -> hmac ;T0[ I" (p1, p2);T@'FI" HMAC;TcRDoc::NormalClass00