contract RequestUid {

    /**
     * MEMBER: counter for request.
    */
    uint256 public requestCount;

    /**
     * CONSTRUCTOR: initial counter with 0.
     */
    constructor() public {
        requestCount = 0;
    }
    
    /**
     * METHOD: generate a new identifier.
     * @dev 3 parameters as inputs:
     * 1. blockhash of previous block;
     * 2. the address of the initialized contract which is requested;
     * 3. the value of counter.
     * @return a 32-byte uid.
     */
    function generateRequestUid() internal returns (bytes32 uid) {
        return keccak256(abi.encodePacked(blockhash(block.number - uint256(1)), address(this), ++requestCount));
    }
}
/**
 * @title A contract for generating unique identifiers for any requests.
 * @dev Any contract that supports requesting inherits this contract to
 * ensure request to be unique.
 */
function generateRequestUid() internal returns (bytes32 uid) {
    return keccak256(abi.encodePacked(blockhash(block.number - uint256(1)), address(this), ++requestCount));
}

/**
 * METHOD: generate a new identifier.
 * @dev 3 parameters as inputs:
 * 1. blockhash of previous block;
 * 2. the address of the initialized contract which is requested;
 * 3. the value of counter.
 * @return a 32-byte uid.
 */