local-cli/bundle/signedsource.js
function sign(file_data) {
  var first_time = file_data.indexOf(TOKEN) !== -1;
  if (!first_time) {
    if (is_signed(file_data))
      file_data = file_data.replace(PATTERN, signing_token());
    else
      throw exports.TokenNotFoundError;
  }
  var signature = md5_hash_hex(file_data, 'utf8');
  var signed_data = file_data.replace(TOKEN, 'SignedSource<<'+signature+'>>');
  return { first_time: first_time,  signed_data: signed_data };
}
function sign(file_data) {
  var first_time = file_data.indexOf(TOKEN) !== -1;
  if (!first_time) {
    if (is_signed(file_data))
      file_data = file_data.replace(PATTERN, signing_token());
    else
      throw exports.TokenNotFoundError;
  }
  var signature = md5_hash_hex(file_data, 'utf8');
  var signed_data = file_data.replace(TOKEN, 'SignedSource<<'+signature+'>>');
  return { first_time: first_time,  signed_data: signed_data };
}
function sign ( file_data ) { var first_time = file_data . indexOf ( TOKEN ) !== - 1 ; if ( ! first_time ) { if ( is_signed ( file_data ) ) file_data = file_data . replace ( PATTERN , signing_token ( ) ) ; else throw exports . TokenNotFoundError ; } var signature = md5_hash_hex ( file_data , 'utf8' ) ; var signed_data = file_data . replace ( TOKEN , 'SignedSource<<' + signature + '>>' ) ; return { first_time : first_time , signed_data : signed_data } ; }
Sign a source file which you have previously embedded a signing token into. Signing modifies only the signing token, so the semantics of the file will not change if you've put it in a comment.  @param  str File contents as a string (with embedded token). @return str Signed data.
Sign a source file which you have previously embedded a signing token into . Signing modifies only the signing token so the semantics of the file will not change if you ve put it in a comment .