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

Function hashString

static/webuploader/webuploader.flashonly.js:4135–4147  ·  view source on GitHub ↗
( str )

Source from the content-addressed store, hash-verified

4133 }
4134
4135 function hashString( str ) {
4136 var hash = 0,
4137 i = 0,
4138 len = str.length,
4139 _char;
4140
4141 for ( ; i < len; i++ ) {
4142 _char = str.charCodeAt( i );
4143 hash = _char + (hash << 6) + (hash << 16) - hash;
4144 }
4145
4146 return hash;
4147 }
4148
4149 uploader.on( 'beforeFileQueued', function( file ) {
4150 var hash = file.__hash || (file.__hash = hashString( file.name +

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected