quic
Version:
A QUIC server/client implementation in Node.js.
27 lines • 955 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
// **Github:** https://github.com/fidm/quic
//
// **License:** MIT
// https://github.com/dcodeIO/long.js/pull/60
const long_1 = tslib_1.__importDefault(require("long"));
// http://isthe.com/chongo/tech/comp/fnv/#FNV-param
const fnvOffset64 = long_1.default.fromString('14695981039346656037', true, 10);
const fnvPrime64 = long_1.default.fromString('1099511628211', true, 10);
function fnv1a64Hash(data, le) {
let hash = long_1.default.fromBits(fnvOffset64.getLowBits(), fnvOffset64.getHighBits(), true);
for (const bit of data) {
hash = hash.xor(bit);
hash = hash.mul(fnvPrime64);
}
return Buffer.from(hash.toBytes(le));
}
exports.fnv1a64Hash = fnv1a64Hash;
class SecureContext {
}
exports.SecureContext = SecureContext;
class SourceToken {
}
exports.SourceToken = SourceToken;
//# sourceMappingURL=crypto.js.map