src/fn/string.js
/**
     * Create a unique string in md5 format.
     *
     * Converts and return all the arguments inserted in a unique string in md5 format.
     *
     * @method   uniqString
     * @global
     *
     * @example
     * ```javascript
     * //"6cb083da4d4987af9b4fa4ad8ca23bb1"
     * bbn.fn.uniqString('test',['test'],{id:1, test:2},4);
     * ```
     * @memberof bbn.fn
     * @returns  {String} The unique string in md5 format
     */
Create a unique string in md5 format.
Converts and return all the arguments inserted in a unique string in md5 format.

@method   uniqString
@global


Create a unique string in md5 format . Converts and return all the arguments inserted in a unique string in md5 format . @method uniqString @global
uniqString(){
      var st = '';
      for ( var i = 0; i < arguments.length; i++ ){
        if (!arguments[i]) {
          st += '__bbn_empty__';
        }
        else if ( typeof(arguments[i]) === 'object' ){
          if (bbn.fn.isArray(arguments[i])) {
            st += JSON.stringify(arguments[i]);
          }
          else{
            let tmp = {};
            let ks = Object.keys(arguments[i]).sort();
            bbn.fn.each(ks, k => {
              tmp[k] = arguments[i][k];
            });
            st += JSON.stringify(tmp);
          }
        }
        else if ( typeof(arguments[i]) !== 'string' ){
          st += arguments[i].toString();
        }
        else{
          st += arguments[i];
        }
      }
      return bbn.fn.md5(st);
    }
uniqString ( ) { var st = '' ; for ( var i = 0 ; i < arguments . length ; i ++ ) { if ( ! arguments [ i ] ) { st += '__bbn_empty__' ; } else if ( typeof ( arguments [ i ] ) === 'object' ) { if ( bbn . fn . isArray ( arguments [ i ] ) ) { st += JSON . stringify ( arguments [ i ] ) ; } else { let tmp = { } ; let ks = Object . keys ( arguments [ i ] ) . sort ( ) ; bbn . fn . each ( ks , k => { tmp [ k ] = arguments [ i ] [ k ] ; } ) ; st += JSON . stringify ( tmp ) ; } } else if ( typeof ( arguments [ i ] ) !== 'string' ) { st += arguments [ i ] . toString ( ) ; } else { st += arguments [ i ] ; } } return bbn . fn . md5 ( st ) ; }
Create a unique string in md5 format.
Create a unique string in md5 format .
// An object with the same properties, even in different order, should produce the same answer