The goog.crypt Namespace

The goog.crypt.Arc4 Class

ARC4 streamcipher implementation. … more

The goog.crypt.BlobHasher Class

Construct the hash computer. … more

The goog.crypt.Hash Class

Create a cryptographic hash instance. … more

The goog.crypt.Hmac Class

… more

The goog.crypt.JpegEncoder Class

Initializes the JpegEncoder. … more

The goog.crypt.Md5 Class

MD5 cryptographic hash constructor. … more

The goog.crypt.Sha1 Class

SHA-1 cryptographic hash constructor. The properties declared here are discussed in the above algorithm document. … more

The goog.crypt.base64 Namespace

… more

The goog.crypt.baseN Namespace

… more

.byteArrayToHex(array)

Turns an array of numbers into the hex string given by the concatenation of the hex values to which the numbers correspond.

array {Array}
Array of numbers representing characters.
returns {string}
Hex string.

.byteArrayToString(array)

Turns an array of numbers into the string given by the concatenation of the characters to which the numbers correspond.

array {Array}
Array of numbers representing characters.
returns {string}
Stringification of the array.

The goog.crypt.hash32 Namespace

… more

.hash_test

.stringToByteArray(str)

Turns a string into an array of bytes; a "byte" being a JS number in the range 0-255.

str {string}
String value to arrify.
returns {Array.<number>}
Array of numbers corresponding to the UCS character codes of each character in str.

.stringToUtf8ByteArray(str)

Converts a JS string to a UTF-8 "byte" array.

str {string}
16-bit unicode string.
returns {Array.<number>}
UTF-8 byte array.

.utf8ByteArrayToString(bytes)

Converts a UTF-8 byte array to JavaScript's 16-bit Unicode.

bytes {Array.<number>}
UTF-8 byte array.
returns {string}
16-bit Unicode string.