import { hashSha1 } from '@tenbot/utils' ; export type CipherSignature = ( opts : { timestamp : string ; nonce : string ; encryptedMessage : string ; } ) => string ; export const createCipherSignature = ( { token } ) : CipherSignature => ( { timestamp , nonce , encryptedMessage } ) => { const sortedString = [ token , timestamp , nonce , encryptedMessage ] . sort ( ) . join ( '' ) ; const signature = hashSha1 ( sortedString ) ; return signature ; } ;