src/sha_dev.js
function packed2arraybuffer(packed, outputLength, bigEndianMod)
	{
		var length = outputLength / 8, i, retVal = new ArrayBuffer(length), shiftModifier, arrView;
		arrView = new Uint8Array(retVal);

		shiftModifier = (bigEndianMod === -1) ? 3 : 0;

		for (i = 0; i < length; i += 1)
		{
			arrView[i] = (packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xFF;
		}

		return retVal;
	}
function packed2arraybuffer(packed, outputLength, bigEndianMod)
	{
		var length = outputLength / 8, i, retVal = new ArrayBuffer(length), shiftModifier, arrView;
		arrView = new Uint8Array(retVal);

		shiftModifier = (bigEndianMod === -1) ? 3 : 0;

		for (i = 0; i < length; i += 1)
		{
			arrView[i] = (packed[i >>> 2] >>> (8 * (shiftModifier + bigEndianMod * (i % 4)))) & 0xFF;
		}

		return retVal;
	}
function packed2arraybuffer ( packed , outputLength , bigEndianMod ) { var length = outputLength / 8 , i , retVal = new ArrayBuffer ( length ) , shiftModifier , arrView ; arrView = new Uint8Array ( retVal ) ; shiftModifier = ( bigEndianMod === - 1 ) ? 3 : 0 ; for ( i = 0 ; i < length ; i += 1 ) { arrView [ i ] = ( packed [ i >>> 2 ] >>> ( 8 * ( shiftModifier + bigEndianMod * ( i % 4 ) ) ) ) & 0xFF ; } return retVal ; }
Convert an array of big-endian words to an ArrayBuffer

@private
@param {Array<number>} packed Array of integers to be converted to
an ArrayBuffer
@param {number} outputLength Length of output in bits
@param {number} bigEndianMod Modifier for whether hash function is
big or small endian
@return {ArrayBuffer} Raw bytes representation of the parameter in an
ArrayBuffer
Convert an array of big - endian words to an ArrayBuffer