crypt.hash32

Classes


Public Protected Private

Global Functions

goog.crypt.hash32.encodeByteArray(bytesopt_offsetopt_lengthopt_seed) number
Hashes a "byte" array to a 32-bit value using the supplied seed.
Arguments:
bytes : Array.<number>
Array of bytes.
opt_offset : number=
The starting position to use for hash computation.
opt_length : number=
Number of bytes that are used for hashing.
opt_seed : number=
The seed.
Returns: number  32-bit hash.
code »
goog.crypt.hash32.encodeInteger(value) number
Hashes an integer to a 32-bit value.
Arguments:
value : number
Number to hash.
Returns: number  32-bit hash.
code »
goog.crypt.hash32.encodeString(str) number
Hashes a string to a 32-bit value.
Arguments:
str : string
String to hash.
Returns: number  32-bit hash.
code »
goog.crypt.hash32.encodeStringUtf8(str) number
Hashes a string to a 32-bit value, converting the string to UTF-8 before doing the encoding.
Arguments:
str : string
String to hash.
Returns: number  32-bit hash.
code »
goog.crypt.hash32.mix32_(mix) number
Performs an inplace mix of an object with the integer properties (a, b, c) and returns the final value of c.
Arguments:
mix : Object
Object with properties, a, b, and c.
Returns: number  The end c-value for the mixing.
code »
goog.crypt.hash32.toSigned_(n) number
Converts an unsigned "byte" to signed, that is, convert a value in the range (0, 2^8-1) to (-2^7, 2^7-1) in order to be compatible with Java's byte type.
Arguments:
n : number
Unsigned "byte" value.
Returns: number  Signed "byte" value.
code »
goog.crypt.hash32.wordAt_(bytesoffset) number
Returns the word at a given offset. Treating an array of bytes a word at a time is far more efficient than byte-by-byte.
Arguments:
bytes : Array.<number>
Array of bytes.
offset : number
Offset in the byte array.
Returns: number  Integer value for the word.
code »

Global Properties

goog.crypt.hash32.CONSTANT32 :
Arbitrary constant used during hashing. See CONSTANT32 in http://go/base.hash.java
Code »
goog.crypt.hash32.SEED32 :
Default seed used during hashing, digits of pie. See SEED32 in http://go/base.hash.java
Code »

Package crypt

Package Reference