How To...

If you want to use this service client side you will need to use JSONP in order to overcome the browser's cross-domain restrictions. If you want to make the service return JSONP you should call the following endpoint:

http://api.filemd5.net/v1/hash?url={URL to the file}&format=jsonp&callback={name of function}

JSONP can seem a little complicated when you have not used it before. Thankfully, most Javascript frameworks allows you to consume REST-ful JSONP endpoints very easily. Here is an example of how you would consume the service using the jQuery Library:

$.getJSON("http://api.filemd5.net/v1/hash?url={URL to the file}&format=jsonp&callback=?",
	function(data){
		alert(data.MD5);
	}
);

Example

Enter any file URL into the text box, then click on the button to obtain the MD5 hash of the file

Now that we got the hight level stuff covered, you might want to have a look at a working Demo.