 	_sendOp: (project_id, doc_id, op) ->
 		RealTimeRedisManager.sendData {project_id, doc_id, op}
 
+	_computeHash: (content) ->
+		return crypto.createHash('sha1')
+			.update("blob " + content.length + "\x00")
+			.update(content, 'utf8')
+			.digest('hex')
+

			logger.log project_id: project_id, doc_id: doc_id, error: error, "applied update"
			model.getSnapshot doc_key, (error, data) =>
				return callback(error) if error?
				docLines = data.snapshot.split(/\r\n|\n|\r/)
				callback(null, docLines, data.v, model.db.appliedOps[doc_key] or [])


{EventEmitter} = require "events"
util = require "util"
RealTimeRedisManager = require "./RealTimeRedisManager"
crypto = require "crypto"

ShareJsModel:: = {}
util.inherits ShareJsModel, EventEmitter
