src/sha_dev.js
function getOutputOpts(options)
	{
		var retVal = {"outputUpper" : false, "b64Pad" : "=", "shakeLen" : -1},
			outputOptions;
		outputOptions = options || {};

		retVal["outputUpper"] = outputOptions["outputUpper"] || false;

		if (true === outputOptions.hasOwnProperty("b64Pad"))
		{
			retVal["b64Pad"] = outputOptions["b64Pad"];
		}

		if ((true === outputOptions.hasOwnProperty("shakeLen")) && ((8 & SUPPORTED_ALGS) !== 0))
		{
			if (outputOptions["shakeLen"] % 8 !== 0)
			{
				throw new Error("shakeLen must be a multiple of 8");
			}
			retVal["shakeLen"] = outputOptions["shakeLen"];
		}

		if ("boolean" !== typeof(retVal["outputUpper"]))
		{
			throw new Error("Invalid outputUpper formatting option");
		}

		if ("string" !== typeof(retVal["b64Pad"]))
		{
			throw new Error("Invalid b64Pad formatting option");
		}

		return retVal;
	}
function getOutputOpts(options)
	{
		var retVal = {"outputUpper" : false, "b64Pad" : "=", "shakeLen" : -1},
			outputOptions;
		outputOptions = options || {};

		retVal["outputUpper"] = outputOptions["outputUpper"] || false;

		if (true === outputOptions.hasOwnProperty("b64Pad"))
		{
			retVal["b64Pad"] = outputOptions["b64Pad"];
		}

		if ((true === outputOptions.hasOwnProperty("shakeLen")) && ((8 & SUPPORTED_ALGS) !== 0))
		{
			if (outputOptions["shakeLen"] % 8 !== 0)
			{
				throw new Error("shakeLen must be a multiple of 8");
			}
			retVal["shakeLen"] = outputOptions["shakeLen"];
		}

		if ("boolean" !== typeof(retVal["outputUpper"]))
		{
			throw new Error("Invalid outputUpper formatting option");
		}

		if ("string" !== typeof(retVal["b64Pad"]))
		{
			throw new Error("Invalid b64Pad formatting option");
		}

		return retVal;
	}
function getOutputOpts ( options ) { var retVal = { "outputUpper" : false , "b64Pad" : "=" , "shakeLen" : - 1 } , outputOptions ; outputOptions = options || { } ; retVal [ "outputUpper" ] = outputOptions [ "outputUpper" ] || false ; if ( true === outputOptions . hasOwnProperty ( "b64Pad" ) ) { retVal [ "b64Pad" ] = outputOptions [ "b64Pad" ] ; } if ( ( true === outputOptions . hasOwnProperty ( "shakeLen" ) ) && ( ( 8 & SUPPORTED_ALGS ) !== 0 ) ) { if ( outputOptions [ "shakeLen" ] % 8 !== 0 ) { throw new Error ( "shakeLen must be a multiple of 8" ) ; } retVal [ "shakeLen" ] = outputOptions [ "shakeLen" ] ; } if ( "boolean" !== typeof ( retVal [ "outputUpper" ] ) ) { throw new Error ( "Invalid outputUpper formatting option" ) ; } if ( "string" !== typeof ( retVal [ "b64Pad" ] ) ) { throw new Error ( "Invalid b64Pad formatting option" ) ; } return retVal ; }
Validate hash list containing output formatting options, ensuring
presence of every option or adding the default value

@private
@param {{outputUpper : (boolean|undefined), b64Pad : (string|undefined),
shakeLen : (number|undefined)}=} options Hash list of output formatting options
@return {{outputUpper : boolean, b64Pad : string, shakeLen : number}} Validated
hash list containing output formatting options
Validate hash list containing output formatting options ensuring presence of every option or adding the default value