Belajar Pemrograman Ruby: Digest

Tulisan kemarin membahas Secure Random.

Digest merupakan modul yang digunakan untuk membuat signature sebagai bukti integritas file.

require 'digest'

s = 'Sssst!'
puts Digest::MD5.hexdigest(s)
puts Digest::SHA1.hexdigest(s)
puts Digest::SHA2.hexdigest(s)

Output

e3bcffe53e4c9b0cca5238c82a699f8d
f68c1b2d72edc61e3824f91339be616e1696b988
6c4337447408cd7414fcd7f09595f90cfef7e4f86a3e16d2d97dfd484f5d1050

Keep Fun Coding 😀

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s