lib/index.js
function generateSignature(secretKey, method, contentMd5, contentType, date, canonicalizedHeaders, canonicalizedResource) {

    var hmac = _crypto2.default.createHmac(SHA256, secretKey);

    var headers = canonicalizedHeaders.map(function (header) {
        return header.toLowerCase();
    }).sort().join('\n');

    var data = method + '\n' + contentMd5 + '\n' + contentType + '\n' + date + '\n';

    if (headers && headers.length) {
        data += headers + '\n';
    }
    data += canonicalizedResource;
    hmac.update(data);
    return hmac.digest(ENCODING);
}
function generateSignature(secretKey, method, contentMd5, contentType, date, canonicalizedHeaders, canonicalizedResource) {

    var hmac = _crypto2.default.createHmac(SHA256, secretKey);

    var headers = canonicalizedHeaders.map(function (header) {
        return header.toLowerCase();
    }).sort().join('\n');

    var data = method + '\n' + contentMd5 + '\n' + contentType + '\n' + date + '\n';

    if (headers && headers.length) {
        data += headers + '\n';
    }
    data += canonicalizedResource;
    hmac.update(data);
    return hmac.digest(ENCODING);
}
function generateSignature ( secretKey , method , contentMd5 , contentType , date , canonicalizedHeaders , canonicalizedResource ) { var hmac = _crypto2 . default . createHmac ( SHA256 , secretKey ) ; var headers = canonicalizedHeaders . map ( function ( header ) { return header . toLowerCase ( ) ; } ) . sort ( ) . join ( '\n' ) ; var data = method + '\n' + contentMd5 + '\n' + contentType + '\n' + date + '\n' ; if ( headers && headers . length ) { data += headers + '\n' ; } data += canonicalizedResource ; hmac . update ( data ) ; return hmac . digest ( ENCODING ) ; }
see: http://115.236.113.201/doc/nos_user_manual/_build/html/accessControl.html#head 
generate signature
@param secretKey
@param method
@param contentMd5
@param contentType
@param date
@param canonicalizedHeaders
@param canonicalizedResource
@return {String} signature
@private
see : http : // 115 . 236 . 113 . 201 / doc / nos_user_manual / _build / html / accessControl . html#head generate signature