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

Function hashString

static/webuploader/webuploader.noimage.js:3930–3942  ·  view source on GitHub ↗
( str )

Source from the content-addressed store, hash-verified

3928 }
3929
3930 function hashString( str ) {
3931 var hash = 0,
3932 i = 0,
3933 len = str.length,
3934 _char;
3935
3936 for ( ; i < len; i++ ) {
3937 _char = str.charCodeAt( i );
3938 hash = _char + (hash << 6) + (hash << 16) - hash;
3939 }
3940
3941 return hash;
3942 }
3943
3944 uploader.on( 'beforeFileQueued', function( file ) {
3945 var hash = file.__hash || (file.__hash = hashString( file.name +

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected