> For the complete documentation index, see [llms.txt](https://gitbook.umiverse.io/sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.umiverse.io/sdk/signature/typescript.md).

# Typescript

```typescript
import md5 from 'md5';

interface Params {
  [key: string]: any;
}

function generateSign(params: Params, secretKey: string): string {
  const timestamp = Math.floor(Date.now() / 1000).toString();
  const sortedParams = Object.keys(params).sort().reduce((acc, key) => {
    acc[key] = params[key];
    return acc;
  }, {});
  sortedParams['timestamp'] = timestamp;
  const signStr = Object.keys(sortedParams).map(key => `${key}=${sortedParams[key]}`).join('&') + secretKey;
  return md5(signStr);
}
```

In this implementation, we define an interface `Params` to represent the object parameter. The `generateSign` function takes two parameters: the object parameter `params` and the secret key `secretKey`. The function first generates a timestamp and adds it to the sorted object parameter. It then concatenates the name-value pairs with the secret key and generates the md5 hash of the resulting string. The function returns the md5 hash as the sign.
