Code coverage report for usr/local/google/home/trevj/src/uproxy-lib/build/dev/uproxy-lib/crypto/djb2hash.js

Statements: 20% (1 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (1 / 5)      Ignored: none     

All files » usr/local/google/home/trevj/src/uproxy-lib/build/dev/uproxy-lib/crypto/ » djb2hash.js
1 2 3 4 5 6 7 8 9  1              
// Quick port of djb2 for comparison of SDP headers to choose initiator.
exports.stringHash = function (s) {
    var hash = 5381;
    for (var i = 0; i < s.length; i++) {
        hash = ((hash << 5) + hash) + s.charCodeAt(i); // hash * 33 + c
    }
    return hash;
};