Sample code for 30+ languages & platforms
Tcl

Workaround for the deprecated Crypt2.HashFile method

Shows how to replace the deprecated HashFile method. (Chilkat is moving away from the use of CkByteData.)

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set crypt [new_CkCrypt2]

CkCrypt2_put_HashAlgorithm $crypt "sha256"

set path "c:/someDir/example.dat"

# ------------------------------------------------------------------------
# The HashFile method is deprecated:

set outData [new_CkByteData]

set success [CkCrypt2_HashFile $crypt $path $outData]

# ------------------------------------------------------------------------
# Workaround.
# (Chilkat is moving away from using CkByteData)

CkCrypt2_put_EncodingMode $crypt "hex_lower"
set hex_hash [CkCrypt2_hashFileENC $crypt $path]

delete_CkCrypt2 $crypt
delete_CkByteData $outData