Sha256: f571783f0d18c60b8f01b02a344abdd911af004508b5eefe3fbe4f88f3406c20

Contents?: true

Size: 867 Bytes

Versions: 3

Compression:

Stored size: 867 Bytes

Contents

/*!
 * UI development toolkit for HTML5 (OpenUI5)
 * (c) Copyright 2009-2018 SAP SE or an SAP affiliate company.
 * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
 */
sap.ui.define([], function() {
	"use strict";

	/**
	 * Generates a hash-code from a string.
	 *
	 * @example
	 * sap.ui.require(["sap/base/strings/hash"], function(hash) {
	 *      hash(""); // 0
	 *      hash("test"); // 3569518
	 * });
	 *
	 * @function
	 * @since 1.58
	 * @param {string} sString The string to generate the hash-code from
	 * @alias module:sap/base/strings/hash
	 * @return {int} The generated hash-code
	 * @private
	 */
	var fnHash = function(sString) {
		var i = sString.length, iHash = 0;

		while (i--) {
			iHash = (iHash << 5) - iHash + sString.charCodeAt(i);
			iHash = iHash & iHash; // convert to 32 bit
		}

		return iHash;
	};

	return fnHash;
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fiveapples-0.0.7 lib/openui5-runtime-1.60.23/resources/sap/base/strings/hash-dbg.js
fiveapples-0.0.6 lib/openui5-runtime-1.60.23/resources/sap/base/strings/hash-dbg.js
fiveapples-0.0.5 lib/openui5-runtime-1.60.23/resources/sap/base/strings/hash-dbg.js