Calculating Checksum

Ruby provides a build-in module called digest to calculate the checksum for a file. The digest module does not require any extra installation.

Include the digest module using the following code sample:

require 'digest'

Code Sample to Calculate Checksum

checksum = Digest::SHA2.hexdigest("Path of the file") );

Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.