Skip to content

Instantly share code, notes, and snippets.

@Khobalt
Last active May 16, 2017 21:36
Show Gist options
  • Save Khobalt/ac39f00ab7647cec193c0530307b4e8f to your computer and use it in GitHub Desktop.
Save Khobalt/ac39f00ab7647cec193c0530307b4e8f to your computer and use it in GitHub Desktop.
This gist demonstrates how to validate the files in a pool against their sha1 hashes.
REM read more about assetPools here: http://docs.brightsign.biz/display/DOC/roAssetPool
REM read more about syncspecs here: http://docs.brightsign.biz/display/DOC/roSyncSpec
REM Sha1's should be calculated on the server and placed into an entry of the sync spec like so:
REM <download>
REM <name>autoplay-Project 1.xml</name>
REM <hash method="SHA1">a8e24dcfb83a694da58bafb3ab763c07ca842baf</hash>
REM <size>7962</size>
REM <link>pool/a/f/sha1-a8e24dcfb83a694da58bafb3ab763c07ca842baf</link>
REM </download>
'CreateObject("roAssetPool", pool_path As String)
pool = CreateObject ("roAssetPool", "SD:/pool")
sync_spec = createObject("roSyncSpec")
sync_spec.readFromFile("path/to/sync.xml")
if pool.validate(sync_spec) then
print "Files match their sha1's"
else
print "Failure validating files"
print pool.getFailureReason()
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment