How to use the cuint.UINT32.prototype function in cuint

To help you get started, we’ve selected a few cuint examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pierrec / js-xxhash / build / xxhash.lmd.js View on Github external
;(function (root) {

	var UINT32 = require('cuint').UINT32

	/*
		Merged this sequence of method calls as it speeds up
		the calculations by a factor of 2
	 */
	// this.v1.add( other.multiply(PRIME32_2) ).rotl(13).multiply(PRIME32_1);
	UINT32.prototype.xxh_update = function (low, high) {
		var b00 = PRIME32_2._low
		var b16 = PRIME32_2._high

		var c16, c00
		c00 = low * b00
		c16 = c00 >>> 16

		c16 += high * b00
		c16 &= 0xFFFF		// Not required but improves performance
		c16 += low * b16

		var a00 = this._low + (c00 & 0xFFFF)
		var a16 = a00 >>> 16

		a16 += this._high + (c16 & 0xFFFF)
github pierrec / js-xxhash / lib / xxhash.js View on Github external
/**
xxHash implementation in pure Javascript

Copyright (C) 2013, Pierre Curto
MIT license
*/
var UINT32 = require('cuint').UINT32

/*
	Merged this sequence of method calls as it speeds up
	the calculations by a factor of 2
 */
// this.v1.add( other.multiply(PRIME32_2) ).rotl(13).multiply(PRIME32_1);
UINT32.prototype.xxh_update = function (low, high) {
	var b00 = PRIME32_2._low
	var b16 = PRIME32_2._high

	var c16, c00
	c00 = low * b00
	c16 = c00 >>> 16

	c16 += high * b00
	c16 &= 0xFFFF		// Not required but improves performance
	c16 += low * b16

	var a00 = this._low + (c00 & 0xFFFF)
	var a16 = a00 >>> 16

	a16 += this._high + (c16 & 0xFFFF)

cuint

Unsigned integers for Javascript

MIT
Latest version published 8 years ago

Package Health Score

50 / 100
Full package analysis