lib/altshift/core/base.js
function hash(object) {
    if (object === undefined || isScalar(object)) {
        return '' + object;
    }

    if (object.hash) {
        return object.hash();
    }

    //Default implementation
    var hashes = [],
        value, key, hashKey, hashValue;

    for (key in object) {
        if (object.hasOwnProperty(key)) {
            value = object[key];
            hashKey = String(key);
            hashValue = hash(value);
            hashValue = (hashKey > hashValue) ? hashValue + hashKey : hashKey + hashValue;
            hashes.push(hashValue);
        }
    }

    return hashes.sort().join('');
}
function hash(object) {
    if (object === undefined || isScalar(object)) {
        return '' + object;
    }

    if (object.hash) {
        return object.hash();
    }

    //Default implementation
    var hashes = [],
        value, key, hashKey, hashValue;

    for (key in object) {
        if (object.hasOwnProperty(key)) {
            value = object[key];
            hashKey = String(key);
            hashValue = hash(value);
            hashValue = (hashKey > hashValue) ? hashValue + hashKey : hashKey + hashValue;
            hashes.push(hashValue);
        }
    }

    return hashes.sort().join('');
}
function hash ( object ) { if ( object === undefined || isScalar ( object ) ) { return '' + object ; } if ( object . hash ) { return object . hash ( ) ; } //Default implementation var hashes = [ ] , value , key , hashKey , hashValue ; for ( key in object ) { if ( object . hasOwnProperty ( key ) ) { value = object [ key ] ; hashKey = String ( key ) ; hashValue = hash ( value ) ; hashValue = ( hashKey > hashValue ) ? hashValue + hashKey : hashKey + hashValue ; hashes . push ( hashValue ) ; } } return hashes . sort ( ) . join ( '' ) ; }
Return a hash string for the object

@param {*} object
@return {String}
Return a hash string for the object