UNPKG

phpjs

Version:

php.js offers community built php functions in javascript

14 lines (11 loc) 477 B
function sha1_file(str_filename) { // From: http://phpjs.org/functions // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // - depends on: file_get_contents // - depends on: sha1 // * test: skip // * example 1: sha1_file('http://kevin.vanzonneveld.net/pj_test_supportfile_1.htm'); // * returns 1: '40bd001563085fc35165329ea1ff5c5ecbdbbeef' var buf = this.file_get_contents(str_filename); return this.sha1(buf); }