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

Function hashString

static/webuploader/webuploader.html5only.js:4337–4349  ·  view source on GitHub ↗
( str )

Source from the content-addressed store, hash-verified

4335 }
4336
4337 function hashString( str ) {
4338 var hash = 0,
4339 i = 0,
4340 len = str.length,
4341 _char;
4342
4343 for ( ; i < len; i++ ) {
4344 _char = str.charCodeAt( i );
4345 hash = _char + (hash << 6) + (hash << 16) - hash;
4346 }
4347
4348 return hash;
4349 }
4350
4351 uploader.on( 'beforeFileQueued', function( file ) {
4352 var hash = file.__hash || (file.__hash = hashString( file.name +

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected