MCPcopy Create free account
hub / github.com/TruthHun/BookStack / hashString

Function hashString

static/webuploader/webuploader.withoutimage.js:3893–3905  ·  view source on GitHub ↗
( str )

Source from the content-addressed store, hash-verified

3891 }
3892
3893 function hashString( str ) {
3894 var hash = 0,
3895 i = 0,
3896 len = str.length,
3897 _char;
3898
3899 for ( ; i < len; i++ ) {
3900 _char = str.charCodeAt( i );
3901 hash = _char + (hash << 6) + (hash << 16) - hash;
3902 }
3903
3904 return hash;
3905 }
3906
3907 uploader.on( 'beforeFileQueued', function( file ) {
3908 var hash = file.__hash || (file.__hash = hashString( file.name +

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected