         if doc.checksum?
             doc.checksum = doc.checksum.toLowerCase()
             return not doc.checksum.match /^[a-f0-9]{40}$/
+        else
+            return false
+
+    # TODO comments, tests
+    sameBinary: (one, two, callback) ->
+        if one.checksum? and one.checksum is two.checksum
+            return true
+        else if one.remote?.file
+            oneId = one.remote.file._id
+            twoId = two.remote.file._id
+            return oneId and oneId is twoId
         else
             return false
 

                if file
                    doc._rev = file._rev
                    doc.creationDate ?= file.creationDate
                    if file.checksum is doc.checksum
                        doc.size  ?= file.size
                        doc.class ?= file.class
                        doc.mime  ?= file.mime

    # Expectations:
    #   - the new file path and name are present and valid
    #   - the old file path and name are present and valid
    #   - the checksum is valid, if present
    #   - the two paths are not the same
    #   - the revision for the old file is present
    # Actions:
